Standard Input and Output Objects
The library defines four IO objects. To handle input, we use an object of type
istream named cin (pronounced see-in). This object is also referred to as the
standard input. For output, we use an ostream object named cout (pronounced
see-out). This object is also known as the standard output. The library also defines
two other ostream objects, named cerr and clog (pronounced see-errand see-log,
respectively). We typically use cerr, referred to as the standard error, for warning
and error messages and clog for general information about the execution of the
program.
Ordinarily,the system associates each of these objects with the window in which
the program is executed. So, when we read from cin, data are read from the window
in which the program is executing, and when we write to cout, cerr, or clog, the
output is written to the same window.