1// fstream::open / fstream::close
2#include <fstream> // std::fstream
3
4int main () {
5
6 // instantiating the file stream
7 std::fstream fs;
8
9 // opening the file with the fstream
10 fs.open ("test.txt", std::fstream::in | std::fstream::out | std::fstream::app);
11
12 fs << " more lorem ipsum";
13
14 // closing the file
15 fs.close();
16
17 return 0;
18}