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

A.2. IOStream Overview

In “Type-Safe I/O” on page 55, you learned the basics for performing input (extraction) and output (insertion). The insertion operator (<<) inserts bytes into an output stream, such as cout (standard output) or cerr (standard error). Similarly, the extraction operator (>>) extracts bytes from an input stream, such as cin (standard input). The task of the IOStream library is to convert streams of bytes from an input stream into data that is consistent with its argument type. The IOStream library also converts the binary representation of a data value into bytes for an output stream. Thus, if i is an integer, the statement

cin >> i; 

converts bytes from istream cin into an integer value. Likewise, the statement

 cout << ...
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