How do you make it so you write to the end of a file, instead of writing over the file?
How do you make it so you write to the end of a file, instead of writing over the file?
I suggest you show us a piece of you code that wirtes over the file, and we'll correct it to appending to the file...
Hi,
when you use
check the predefined constants in ios_base class:Code:void open(const char *s, ios_base::openmode mode = ios_base::out | ios_base::trunc);
and provide ios_base :: app instead of ios_base::truncCode:static const openmode app, ate, binary, in, out, trunc;
e.g.
Code:output.open("data.txt", ios_base::out | ios_base::app);