MMHMM I'm fairly new at this but I just need a little guidance with a program code.
What I did in this code was inputing and outputing data files. Which I then made it output to a file I called data.txt. Then used cout to print the data in the vector named orginal
But now I need to close the ostream and then open it with ifstream. for a text file I created (which I called data.txt using ofstream and then put that data into a new vector which I will call processed
Bascially I'm not sure how to do this? Do I need to create another function to make it close or can I use something to do it? Thanks for the help
Is this the correct way on how to use it?
////
cout<<"Please enter name of outpout file: ";
cin>>name;
ofstream ost(name.c_str());
if(!ost)error("can't open output file", name);
name.close();
////
When I did the compiler gave me "error: 'struct String' has no member named 'close' "
does this mean I have to define it first?
cout<<"Please enter name of outpout file: ";
cin>>name;
ofstream ost(name.c_str());
if(!ost)error("can't open output file", name);
ost.close();
produced 7 9 11 9 7 and totally skipped the cout for the input
So how do I use use ifstream to open my .txt file [I need to close the ofstream and the open an ifstream for data.txt (which I had already made before)]
do i just use ost.open(); ?