He probably meant ios::ate mode. It will place cursor position at end file after opening, so following: std::ostream x("file.txt", ios::out|ios::ate)
is equals to
When you open a file it is ready to be written at its beginning. If you open it with ios::ate you will be ready to write at its end, but can move around it and write to other parts of the file. If you open it with ios::app you will be able to write ONLY at its end, because each operation will place you back at its end before being executed.
To delete a file you can use http://www.cplusplus.com/reference/cstdio/remove/
To edit a file there is no immediate way. Any write operation performed in the middle of a stream will overwrite as much old data as what you're trying to write.
You have to open a new empty file, copy all the data until you get to the part that you want to edit, write the changes, and then copy the rest of the old file. Then remove the old file and rename the new.
ios::ate seeks to the eof(end of file) upon opening the file. the input/output operations can still occur anywhere within the file......i.e. u can write anywhere in the file,even over the old data.
The format of using is:
objectname.open("Nameofthefile",ios::ate)