13. Stream Input/Output: A Deeper Look

Consciousness ... does not appear to itself chopped up in bits ... A “river” or a “stream” are the metaphors by which it is most naturally described.

—William James

Objectives

In this chapter you’ll learn:

• To use C++ object-oriented stream input/output.

• To format input and output.

• The stream-I/O class hierarchy.

• To use stream manipulators.

• To control justification and padding.

• To determine the success or failure of input/output operations.

• To tie output streams to input streams.

Get C++ How to Program, Ninth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.