How to append text to a text file in C++?

Dratted re-post bot: original question from
https://stackoverflow.com/questions/2393345/how-to-append-text-to-a-text-file-in-c

1
2
3
4
5
6
7
8
9
#include <fstream>
using namespace std;

int main()
{
   const char filename[] = "output.txt";
   ofstream out( filename, ofstream::app );
   out << "Yet another line of text" << '\n';
}


Can't remove this thread until seeplus removes his post.
Last edited on
Topic archived. No new replies allowed.