is it ok to use ios::trunc even if you don't know if the file exists? as I want to write to a new file or re-write an existing one. How would I go about this?
Printable View
is it ok to use ios::trunc even if you don't know if the file exists? as I want to write to a new file or re-write an existing one. How would I go about this?
Seems ok!Quote:
ios::trunc
If the file opened for output operations already existed before, its previous content is deleted and replaced by the new one.