FStream.... myFile.flush() won't work
I assume the flush() command in FStream clears the file of any data.
If not how do i do that.
But if so:
fstream fFile;
fFile.open (filename, fstream::in | fstream::out | fstream::app);
fFile.flush();
fFile.close();
but it seems to do nothing to the file
Thanks
i did, thats the only command i could find that mentioned anything like it.
http://www.cplusplus.com/ref/iostream/fstream/
http://www.cplusplus.com/ref/iostream/fstream/
Flush is not used to empty out a file. If you want the file to be emptied out, you need to do that with the flags.
There is a good article <a hef="http://www.gamedev.net/reference/articles/article1127.asp">here</a>.
There is a good article <a hef="http://www.gamedev.net/reference/articles/article1127.asp">here</a>.
quote:Original post by Anonymous Poster
There is a good article <a hef="http://www.gamedev.net/reference/articles/article1127.asp">here</a>.
That article has old info (even though it was submitted in 2000, tsk tsk). It uses <fstream.h> and <iostream.h>. Those contain some things non-existent in the current <fstream> and <iostream> headers. Such as ios::noreplace and ios::nocreate.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement