diff --git a/hw1_pt1/funcs.h b/hw1_pt1/funcs.h index 39c263cdfe14ff9a31e31c9b397c4b7644c6e18e..6e11dbed0c8ba76b59d16d7daa7c0f9a285bd9a3 100644 --- a/hw1_pt1/funcs.h +++ b/hw1_pt1/funcs.h @@ -15,7 +15,9 @@ fstream CreateData_1(); template fstream CreateData_2() { - fstream outf("2.txt");; + fstream outf("2.txt"); //!!! Ипользовать надо либо ifstream, либо ofstream + + ostream_iterator Out (outf , " " ); vector tmp(100); generate(tmp.begin(), tmp.end(), [] () {return (-50 + rand()%100);}); @@ -23,7 +25,7 @@ fstream CreateData_2() return outf; } template -ContainerType LoadData_1(fstream &f) +ContainerType LoadData_1(fstream &f) //!!! Ипользовать надо либо ifstream, либо ofstream { using value_type = typename ContainerType::value_type; ContainerType ans(100); @@ -33,7 +35,7 @@ ContainerType LoadData_1(fstream &f) return ans; } template -ContainerType LoadData_2(fstream &f) +ContainerType LoadData_2(fstream &f) //!!! Ипользовать надо либо ifstream, либо ofstream { using value_type = typename ContainerType::value_type; ContainerType l; @@ -147,7 +149,8 @@ template void menu3(Container& x) { char c; - fstream outf; + fstream outf; //!!! Ипользовать надо либо ifstream, либо ofstream + cout << "press f to output result with file streams, i - to do it with stream iterators, otherwise result won't be outputted." << endl; cin >> c; switch (c) {