I want to append to a .txt file, adding directly after the last character in the file without going to a new line. How can I do that? If the file is empty, write at the beginning of it.
I used ios::app
to write but the new data goes to next line, but I need it to be added in the same line with the old data, right after the last character.
ofstream fOut2;
fOut2.open("Temp/SchoolYear.csv", ios::out | ios::app);
fOut2 << y1 << “/” << y2 << “,”;
New contributor
dummylearningtocode is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
2