that is the intended behaviour if you open the file for appending.
try
file.open("file.html", std::ios::out); //Opens the file in output mode
file.seekp(-23, std::ios::end); //goes to 23 bytes [I]before[/I] the end of file
file << "something" << std::endl;//Writes that something
file.open("file.html", std::ios::out); //Opens the file in output mode
file.seekp(-23, std::ios::end); //goes to 23 bytes [I]before[/I] the end of file
file << "something" << std::endl;//Writes that something
To copy to clipboard, switch view to plain text mode
note, however, that opening a file in ascii mode and writing out a string as done above usually does not make sense with byte counting and going to 23 bytes before the end...
Bookmarks