Skip to Content
Navigating C++ and Object-Oriented Design
book

Navigating C++ and Object-Oriented Design

by Paul Anderson, Gail Anderson
October 1997
Intermediate to advanced
800 pages
20h 48m
English
Pearson
Content preview from Navigating C++ and Object-Oriented Design

2.4. Type-Safe I/O

The C++ IOStream library handles input and output with the following.

#include <iostream.h> 

cin >> name;               // standard input
cout << name;              // standard output
cerr << name;              // standard error

The name cin (pronounced “see-in”) with stream operator >> reads values from standard input (your keyboard by default). The name cout (pronounced “see-out”) with stream operator << writes to standard output (your CRT screen by default). Likewise, the name cerr with stream operator << writes error messages to standard error (your CRT screen by default). You must include <iostream.h> to use these names and operators.

The stream names and operators are appealing because they are type safe and easy to use. More than one C++ variable may appear ...

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.
Start your free trial

You might also like

Exploring C++20: The Programmer's Introduction to C++

Exploring C++20: The Programmer's Introduction to C++

Ray Lischner

Publisher Resources

ISBN: 0135327482Purchase book