hi, i researched but couldnt find a definite answer to this: as far as i know when using ofstream to open a file for writing, all pre-existing contents get deleted by default, so in this case i dont see a use for the ios::trunc arg.
So i thought it comes useful when instead of ostream, one uses fstream to open the file.
I'm not sure though because sometimes i do: fstream myfile("file.txt",ios::out) and the contents are not deleted at opening (in this case i could see a use for adding ios::trunc), but some other times they are deleted at the opening (behaving like ofstream, and in this case there would be no need to use ios::trunc); when do you use ios::trunc usually?
thanks for any suggestion