Updating file attached to ofstream.
C / C++ / MFC
1
Posts
1
Posters
0
Views
1
Watching
-
I got a simple DOS app. primary school slash hello world slash newb kind of app. So the thing is, an ofstream opens a file then writes a string, just a word derived from user thru cin >> word; then closes it. Now I need this file to be reopened later in the loop and writen to again while preserving the old data. Tried outFile.open("filename", ios::ate) to force the file pointer to the eof, but can't make work. I am prety sure that is wrong anyhow. What is the right way to do it? Oh, by the way, there must be a way to keep user inputs in some sort of list inside the program code without rellying on ofstreams. Can someone tell me what parts of C++ handles that sort of stuff, just a name would be OK. Thanks for reading this long ass post!