close a filestream c++
// fstream::open / fstream::close
#include <fstream> // std::fstream
int main () {
// instantiating the file stream
std::fstream fs;
// opening the file with the fstream
fs.open ("test.txt", std::fstream::in | std::fstream::out | std::fstream::app);
fs << " more lorem ipsum";
// closing the file
fs.close();
return 0;
}