|Hey. i wanted to ask that i was using the escape sequence \r to write data in files but instead of moving the cursor to the beginning of the current line it moves the cursor to the next line when. However in consloe window it works just fine but in files it functions like \n. As a beginner i am not allowed to use advance stuff like pointers, structure or strings etc etc. So what could be the simplest scenario to move the cursor to the beginning of the current line in a file for the purpose of overwriting the existing txt.
ofstream out("Records.txt" );
out << "This is some text.\rOverwrite";
This is some text.