Chapter 14. Study Guide

File input and output (I/O) aren't glamorous parts of computer programming, but they are fundamental and therefor important. Contemporary C++ programs replace many file I/O operations with database or GUI operations. Nevertheless, these high-level operations rest on C++'s lower-level I/O operations and on an OS's low-level operations. Without file I/O operations, programs can only process small amounts of data and can only produce limited amounts of usable output. The large number of C++ API functions coupled with the many bewildering options exasperates the situation, making it essential that we learn how to use language-specific documentation.

When a program transfers data to or from a file, either reading or writing it, we can view the data as a stream or sequence of bytes. Hence, the C++ objects that perform I/O operations are called stream objects or simply streams. We'll organize the C++ I/O features in four ways to help manage their complexity:

Know

Know about less common features