fstream

I create a file through c++ program.
at the end of my program I have a condition check;
if true -> I want to save the file with new changes;
else-> discard the changes;(not the file)

there is any function to say save the file or cancel it?

I don't want to make a shadow file;
Last edited on
Save to a std::string or std::ostringstream and then when your condition is met, open the file and write to it.
Topic archived. No new replies allowed.