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

C++, How do I overwrite a .txt file?

P: 29
I am trying to overwrite an ifstream file with an ofstream file. How do I do this?
Nov 11 '10 #1
Share this Question
Share on Google+
2 Replies


tlhintoq
Expert 2.5K+
P: 3,525
If the source file exists before you start writting... delete it.
Nov 11 '10 #2

100+
P: 256
ofstream constructor allows you to specify truncation mode, see http://cplusplus.com/reference/iostr...ream/ofstream/
Nov 11 '10 #3

Post your reply

Sign in to post your reply or Sign up for a free account.