devxlogo

<fstream> Open Modes

<fstream> Open Modes

The library defines the following open modes and file attributes:

 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

size=3>
You may combine several flags by using the bitwise OR operator:

 ofstream logfile(

devx-admin

Share the Post: