The C++ language itself has no provision for input and output. The subject of this chapter is the input and output capabilities that are available in the standard library, which provides you with support for device-independent input and output operations in your programs. You’ve used elements of these facilities to read from the keyboard and write to the screen in all the book’s examples so far, and here you’ll expand on that and look at how you can read and write disk files. By the end of this chapter, you’ll have learned
  • What a stream is

  • What the standard streams are

  • How binary streams differ from text streams

  • How to create and use file streams

  • How errors in stream operations are recorded, and how you can manage them

  • How to use unformatted stream operations

  • How to write numerical data to a file as binary data

  • How objects can be written to and read from a stream

  • How to overload the insertion and extraction operators for your classes

  • How to implement stream support for template classes

  • How to create string streams


Input Stream Extraction Operator Insertion Operator Text Mode Binary Mode 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Copyright information

© Ivor Horton 2004

Authors and Affiliations

  • Ivor Horton

There are no affiliations available

Personalised recommendations