38. I/O Streams

What you see is all you get.

– Brian W. Kernighan

Introduction

The I/O Stream Hierarchy

File Streams; String Streams

Error Handling

I/O Operations

Input Operations; Output Operations; Manipulators; Stream State; Formatting

Stream Iterators

Buffering

Output Streams and Buffers; Input Streams and Buffers; Buffer Iterators

Advice

38.1. Introduction

The I/O stream library provides formatted and unformatted buffered I/O of text and numeric values. The definitions for I/O stream facilities are found in <istream>, <ostream>, etc.; see §30.2.

An ostream converts typed objects to a stream of characters (bytes):

Figure represents the process of conversion into a stream of characters with ostream.

Get The C++ Programming Language, 4th 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.