Hello, I have been trying to open a file in append mode and write something in a determined position of the file, I have been trying to do it like this:
file.open("file.html", std::ios::out | std::ios::app);//Opens the file in output mode and append mode
file.seekp(23, std::ios::end);//goes to 23 bytes(I think) before the end of file
file << "something" << std::endl;//Writes that something
file.open("file.html", std::ios::out | std::ios::app);//Opens the file in output mode and append mode
file.seekp(23, std::ios::end);//goes to 23 bytes(I think) before the end of file
file << "something" << std::endl;//Writes that something
To copy to clipboard, switch view to plain text mode
However even with the seekp function what i write always end's up at the end of the file. I would like to know how can I avoid that from happening.
Thanks for now.
Bookmarks