This removes everything the first code have written and leaves only "Second Column".
I assumed it's something to deal with flags, but I've used flags such as ios::ate , ios::app but it doesn't give me what I wanted.
I want to start again from the beginning of the file.
I want to start again from the beginning of the file.
Open with ate and manually rewind to the beginning.
Plesa notm that if you start writing from the beginning, you will overwrite already existing information. If you need to insert information, you need another approach.
Usually file is loaded into memory, parsed, resulting abstract content is modifies and then it is written into file at once. File is completely rewritten each time.