Hi,
I would like to know if it is possible to read a file and write to the same file at the same time.
For example, if I have
Is there any way to manipulate a .dat file while reading it?Code:#include <fstream> // and other headers using namespace std; string temp_string; char result; fstream studfile; studfile.open("student.dat", ios::in | ios::out); // Is this correct? while (!studfile.eof() ) { getline ( studfile, temp_string); studfile << "Results: " << result << endl; }
I've checked quite a couple of sites, but there are only solutions for binary files..
Thanks! =)



LinkBack URL
About LinkBacks


