Flag Function
ios::app Opens an output file for appending.
ios::ate Opens an existing file (either input or output) and seeks the end.
ios::in Opens an input file. Use ios::in as an open_mode for an ofstream file to prevent truncating an existing file.
ios::out Opens an output file. When you use ios::out for an ofstream object without ios::app, ios::ate, or ios::in, ios::trunc is implied.
ios::nocreate Opens a file only if it already exists; otherwise the operation fails.
ios::noreplace Opens a file only if it does not exist; otherwise the operation fails.
ios::trunc Opens a file and deletes the old file (if it already exists).
ios::binary Opens a file in binary mode (default is text mode).