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-err and 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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access