August 2012
Intermediate to advanced
976 pages
30h 17m
English
Each stream has an associated file mode that represents how the file may be used. Table 8.4 lists the file modes and their meanings.
Table 8.4. File Modes
We can supply a file mode whenever we open a file—either when we call open or when we indirectly open the file when we initialize a stream from a file name. The modes that we can specify have the following restrictions:
• out may be set only for an ofstream or fstream object.
• in may be set only for an ifstream or fstream object.
• trunc may be set only when out is also specified. ...
Read now
Unlock full access