// open the file for reading and writing, fail if file does not exist
std::fstream one( "example.txt", std::ios::in | std::ios::out ) ;
1 2 3 4
// open an existing file for reading and writing,
// or create a new file if it does not exist,
// write always appends to the file
std::fstream one( "example.txt", std::ios::in | std::ios::out | std::ios::app ) ;