RSS Forums RSS

Don't Erase Contents of Text File

Please support our C++ advertiser: Programming Forums
Thread Solved
Reply
Posts: 43
Reputation: cppnewb is an unknown quantity at this point 
Solved Threads: 0
cppnewb's Avatar
cppnewb cppnewb is offline Offline
Light Poster

Don't Erase Contents of Text File

  #1  
Jan 3rd, 2009
Hi, It's me again with another silly question
I was wondering if there was a way using ofstream to not erase the contents of the file it is writing to and simply write at the end.
Thanks!
P.S. I'm using windows XP and Dev C++
AddThis Social Bookmark Button
Reply With Quote  
Posts: 665
Reputation: Freaky_Chris is a jewel in the rough Freaky_Chris is a jewel in the rough Freaky_Chris is a jewel in the rough 
Solved Threads: 107
Freaky_Chris's Avatar
Freaky_Chris Freaky_Chris is offline Offline
Practically a Master Poster

Re: Don't Erase Contents of Text File

  #2  
Jan 3rd, 2009
  1. ofstream myfile("example.txt", std::ios::app);
Hope that helps
app stands for append btw

Chris
Knowledge is power -- But experience is everything
Reply With Quote  
Posts: 43
Reputation: cppnewb is an unknown quantity at this point 
Solved Threads: 0
cppnewb's Avatar
cppnewb cppnewb is offline Offline
Light Poster

Re: Don't Erase Contents of Text File

  #3  
Jan 3rd, 2009
Thanks
Reply With Quote  
Posts: 665
Reputation: Freaky_Chris is a jewel in the rough Freaky_Chris is a jewel in the rough Freaky_Chris is a jewel in the rough 
Solved Threads: 107
Freaky_Chris's Avatar
Freaky_Chris Freaky_Chris is offline Offline
Practically a Master Poster

Re: Don't Erase Contents of Text File

  #4  
Jan 3rd, 2009
Your Welcome,
Go ahead and mark this as solved.

Chris
Knowledge is power -- But experience is everything
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.



Views: 372 | Replies: 3 | Currently Viewing: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 2:37 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC