The
ios::app // appendios::ate // open and seek to file's endios::binary // binary mode I/O (as opposed to text mode)ios::in // open for readios::out // open for writeios::trunc // truncate file to 0 length
You may combine several flags by using the bitwise OR operator:
ofstream logfile(