Chapter 8. The IO Library

CONTENTS

Section 8.1 An Object-Oriented Library 284

Section 8.2 Condition States 287

Section 8.3 Managing the Output Buffer 290

Section 8.4 File Input and Output 293

Section 8.5 String Streams 299

Chapter Summary 302

Defined Terms 302

In C++, input/output is provided through the library. The library defines a family of types that support IO to and from devices such as files and console windows. Additional types allow strings to act like files, which gives us a way to convert data to and from character forms without also doing IO. Each of these IO types defines how to read and write values of the built-in data types. In addition, class designers generally use the library IO facilities to read and write objects of the ...

Get C++ Primer, Fourth 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.