C s Predefined Streams

The Basic Stream Classes

The old-style iostream library uses the header file iostream.h. This file defines the foundational class hierarchy that supports I/O operations. If you will be performing file I/O, then you will need to also include fstream.h. To use array-based I/O, you will need to include strstrea.h.

The lowest-level class is called streambuf. This class provides the basic input and output operations. It is used primarily as a base class for other classes. Unless you are deriving your own I/O classes, you will not use streambuf directly.

The class ios is the base of the class hierarchy that you will typically use when using the C++ I/O system. It provides formatting, error checking, and status information. From ios are derived several classes—sometimes through intermediary classes. The classes derived either directly or indirectly from ios that you will typically use are listed here:

Class

Purpose

istream

General input

ostream

General output

iostream

General input/output

ifstream

File input

ofstream

File output

fstream

File input/output

istrstream

Array-based input

ostrstream

Array-based output

strstream

Array-based input/output




C(s)C++ Programmer's Reference
C Programming on the IBM PC (C Programmers Reference Guide Series)
ISBN: 0673462897
EAN: 2147483647
Year: 2002
Pages: 539

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net