I think this table is most helpful in telling the file modes exactly. It conpares c++ open modes with c open modes
Code:
Table 33: Open modes and their C stdio counterparts
Open Mode C stdio Equivalent Effect
in - "r" Open text file for reading only
out|trunc or out - "w" Truncate to 0 length, if existent, or create text file for writing only
out|app - "a" Append; open or create text file only for writing at end of file
in|out - "r+" Open text file for update (reading and writing)
in|out|trunc - "w+" Truncate to 0 length, if existent, or create text file for update
in|out|app - "a+" - Append; open or create text file for update, writing at end of file
http://stdcxx.apache.org/doc/stdlibug/30-3.html