cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
Problem with input output
Problem with input output
Dec 26, 2009 at 10:13pm UTC
August
(21)
Each time I do the myfile.open and write something to it it overwrites the old information how can I prevent this from happening????????????
Dec 26, 2009 at 10:23pm UTC
tummychow
(1210)
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
Dec 26, 2009 at 10:23pm UTC
Topic archived. No new replies allowed.