File Handling

I am working on an assignment. Not too hard to make a text file and add some data in it, but when i re-enter my program and add some extra data on that text file where some data already present new data will replace with previous one instead of my thinking.
Can you tell me any solution please.
Add data to the end: open file in inpit mode: std::ifstream in(somefile, std::ios::app);
Open file and set output position to the end std::ifstream in(somefile, std::ios::ate);
Or open file and then seek to the end manually
Thanks
Topic archived. No new replies allowed.