Possible Duplicate:
C++ Filehandling: Difference between ios:app and ios:ate?
What is the difference between these two file opening modes ?
ios:ate sets the get/put pointer position to the end of the file so reading/writing will
begin from end, but how is it different from ios::app, which again opens a file in append mode?
When I have created a ofstream and opened it in `ios:app mode, the put stream pointer still points to the beginning, how does the appending work then?
Also, I understand that ifstream, ofstream, and fstream are high-level classes to manage the underlying stream buffer.
Does it mean that even in ios:app mode I can read data from a file?
appcomes from ‘append’ – all output will be added (appended) to the end of the file. In other words you cannot write anywhere else in the file but at the end.atecomes from ‘at end’ – it sets the stream position at the end of the file when you open it, but you are free to move it around (seek) and write wherever it pleases you.