C++ Programming/Code/IO
From Wikibooks, the open-content textbooks collection
< C++ Programming | Code
[edit] I/O
Also commonly referenced as the C++ I/O of the C++ standard since the standard also includes the C Standard library and its I/O implementation, as seen before in the Standard C I/O Section.
The <iostream> library automatically defines a few standard objects:
- cout, an object of the ostream class, which displays data to the standard output device.
- cerr, another object of the ostream class that writes unbuffered output to the standard error device.
- clog, like cerr, but uses buffered output.
- cin, an object of the istream class that reads data from the standard input device.
The <fstream> library allows programmers to do file input and output with the ifstream and ofstream classes.