# include the fstream header file,and create an instance of an fstream object i.e
#include <fstream>
using namespace std;
int main () {
fstream filestr;
filestr.open ("test.txt", fstream::in | fstream::out | fstream::app); // open a file with mode
// >> i/o operations here <<
filestr.close();
return 0;
}
|