In This Chapter
Rediscovering stream I/O as an overloaded operator
Examining the other methods of the file class
Using stream buffer I/O
Programs appearing before this chapter read from the cin input object and output through the cout output object. Perhaps you haven't really thought about it much, but this input/output technique is a subset of what is known as stream I/O.
In this chapter, I describe stream I/O in more detail. I must warn you that stream I/O is too large a topic to be covered completely in a single chapter — entire books are devoted to this one topic. Fortunately for both of us, there isn’t all that much that you need to know about stream I/O to write the vast majority of programs.
Stream I/O is based on overloaded versions of operator>>() and operator<<(). The declaration of these overloaded operators is found in the include file iostream, which are included in all the programs in this book beginning with Chapter 1. The code for these functions is included in the standard library, which your ...