By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,440 Members | 1,411 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,440 IT Pros & Developers. It's quick & easy.

Appended mode ?

P: n/a
Below is my code:

ofstream out(Results);
if (!out.is_open()){
cerr <<"Cannot open file" "" <<Results<<endl;
exit(EXIT_FAILURE);
However, everytime I run the program, it wipes out previous data.
Is there an "append mode?

thanks for any help.

Oct 26 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
tv****@hotmail.com wrote:
Below is my code:

ofstream out(Results);
if (!out.is_open()){
cerr <<"Cannot open file" "" <<Results<<endl;
exit(EXIT_FAILURE);
However, everytime I run the program, it wipes out previous data.
Is there an "append mode?


What does your FM say about 'ofstream' constructors? Hint: there is
the second argument that controls the mode in which the file is opened.
HintHint: std::ios::app

V
Oct 26 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.