August 2012
Intermediate to advanced
976 pages
30h 17m
English
The fstream header defines three types to support file IO: ifstream
to read from a given file, ofstream
to write to a given file, and fstream
, which reads and writes a given file. In § 17.5.3 (p. 763) we’ll describe how to use the same file for both input and output.
These types provide the same operations as those we have previously used on the objects cin and cout. In particular, we can use the IO operators (<< and >>) to read and write files, we can use getline (§ 3.2.2, p. 87) to read an ifstream, and the material covered in § 8.1 (p. 310) applies to these types.
In addition to the behavior that they inherit ...
Read now
Unlock full access