how can I reopen a file later in a program and ot erase everything in it???????
Ofstream doesn't work it erases everything
how can I reopen a file later in a program and ot erase everything in it???????
Ofstream doesn't work it erases everything
Jeff Paddon
Undergraduate Research Assistant
Physics Department
St. Francis Xavier University
Code:#include <fstream.h> int main(void) { const char FILE_NAME[]="Test.txt"; fstream File( FILE_NAME, ios::in || ios::out ); return 0; }
Yes it does, just give ios::app flag to it.Originally posted by kas2002
Ofstream doesn't work it erases everything
Code:ofstream output("code.cpp",ios::app);