PDA

For continued disscussion on this topic : C++ Appending to a file



MtDewBoy1701
07-11-2001, 03:42 AM
Ok... I'm going to college for Computer Science. This really is something I should know, but I haven't used it in so long, and plus with all the HTML and JavaScript stuff I've been doing. Its kinda fried the C++ part of my brain, but anyway, enough of my pointless babbling... How do I open an ofstream file for appending?

Orphious
07-13-2001, 04:44 AM
#include <fstream> this is the header as I remember
ofstream fout;

fout.open ("location to write to such as c:\\text.doc");
if (fout.fail())
{
cout << "Data output failed!\n";
getch();
exit(1);
}