Problem with input output

Each time I do the myfile.open and write something to it it overwrites the old information how can I prevent this from happening????????????
File modes. When you construct it, write it like this:
1
2
ofstream myfile;
myfile.open("filename", ios::out | ios::app);

See this for more:
http://www.cplusplus.com/doc/tutorial/files/
Last edited on
Topic archived. No new replies allowed.