The C++ iostream
library provides hundreds of I/O capabilities. Several headers contain portions of the library interface.
Most C++ programs include the <iostream>
header, which declares basic services required for all stream-I/O operations. The <iostream>
header defines the cin
, cout
, cerr
and clog
objects, which correspond to the standard input stream, the standard output stream, the unbuffered standard error stream and the buffered standard error stream, respectively. (cerr
and clog
are discussed in Section 13.2.3.) Both unformatted and formatted-I/O services are provided.
The <iomanip>
header declares services useful for performing formatted I/O with so-called parameterized stream manipulators, such as setw
and setprecision.
The <fstream>
header declares services for file processing. We use this header in the file-processing programs of Chapter 14.