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?
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!ios::trunc
If the file opened for output operations already existed before, its previous content is deleted and replaced by the new one.
MagosX.com
Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime.