I have a file that is open for both writing and reading using fstream.
However when I use myfile<<"text"; or myfile.write(); nothing happens with the file.
I have also tried myfile.seekp(0); to write at the beggining of the file but nothing is happening.
Is there anything I am missing? Any help on this?
Did you confirm that the file was actually opened (if (!myfile) then the file was not opened)?
Output might be buffered, so if the file is still open when you try to read its contents from outside the program, it may not have been written, yet.