0

Question Regarding Files. ios::ate

Let's say we have created a ofile stream ofstream ofile; ofile.open("Hey.txt", ios::ate); ios::ate takes us to the end of the file, as per the definition. ofile<<"Hello"; //we add a line of code. ofile.close(); //We close the file. My question is, since the file in opened in "Go to the end of line in opening" mode, should it appear that everytime we complie the program, there must be a "Hello" appended to the end of the file?

18th Jun 2020, 11:16 AM
Prashant Pant
Prashant Pant - avatar
1 Answer
0
??? sorry not understand your question, tou cann add everythink you want instead of hello string. and then close the file.
21st Jun 2020, 10:49 AM
george
george - avatar