What you are referring to are text files and not "notepads".
And what you want to do is append content which can be done by opening the file in the "append" mode like this :
std::fstream fs;
fs.open ("test.txt", std::fstream::out | std::fstream::app);