Zhuge, what I am trying to do is make a little program that lets the user input diary entries each day. My problem is I only know how to write to a txt file one time without overriding the previous entry. This is my writing to a file code so far.
Change it to this outFile.open("journal.txt", ios::app);
This is telling it to not overwrite everything in the file everytime and instead append it to the end of the file.
By default ofstream is set to just overwrite everything in the file with the new data. Which is why we need to set the optional flag ios::app which will make it append to the file instead.
More about files and the others optional flags can be found here http://www.cplusplus.com/doc/tutorial/files/ or in the documentation on this site.