i need the variable recno to store the last value in the file called rfile. but when i run the following code, the other recno does not get stored in the file. please help out.
Thanks in advance :D
1 2 3 4 5 6 7 8
for(int i=0; !rfile.eof(); i++)
{ rfile>>recno;
std::cout<<recno;
}
:
:
:
rfile<<recno; //storing the new recno
i tried the following and only 23 got stored into the file...
You can't write to the same file you are reading. If you are going to write to a file instead of to a vector, you will have to write to a new file, then rename the new file to the old file.