Why not just use the (portable) STL? Just create an
fstream
with read and write permissions (which is the default), move the write-cursor to the end of the buffer and start writing. A demonstrating example:
#include <iostream>
#include <fstream>
#include <sstream>
using namespace std;
int main()
{
fstream file("somefile");
file.seekp(0, ios_base::end);
file << "\nadditional stuff";
}