From 169773ce6350d189ed34e6e4b4a709871403e99f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=BB=D1=8C=D1=8F=20=D0=91=D0=BE=D0=B3=D0=B4=D0=B0?= =?UTF-8?q?=D0=BD=D0=BE=D0=B2?= Date: Sat, 8 Jan 2022 16:38:42 +0000 Subject: [PATCH] =?UTF-8?q?=D0=97=D0=B0=D0=BC=D0=B5=D1=87=D0=B0=D0=BD?= =?UTF-8?q?=D0=B8=D1=8F=20=D0=BF=D0=BE=20funcs.h?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hw1_pt1/funcs.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/hw1_pt1/funcs.h b/hw1_pt1/funcs.h index 39c263c..6e11dbe 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) { -- GitLab