Hi all,
I have to create a text file containing a set of results and I have used as
ofstream fout("results.txt,ios::out|ios::app);
where results.txt is the file I would like to put the data.
When I run the code for the first time it is displaying the results in the file properly.But when I execute my program again it append new results to the old results as I am using ios::app.If i dont use ios::app I am not getting the output when I execute for the first time.
How can I clear my initial results each time I run my program?Could anyone give me suggestions
Thanks.