Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo
Thanks a lot, VH.
Well, it seems that this is really an annoying bug. I wrote in my file the text:
and the program:
using namespace std;
fstream file("myfile.txt", ios::in | ios::out);
file.seekg(ios :: beg);
cout<<i<<" "<<input.size()<<" "<<input<<endl;
else cerr << "Error" <<endl<<endl;
works just fine. But, when I added some more text in new lines in my file:
Any idea what's wrong?
Try opening the file in binary mode (add | ios::binary ). Also, it might help to close the file ( file.close(); )
Any of that help?
Thanks, Jim. I've added ios::binary - and the file is not changed if I run my program for several times. It works.