DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
iostream examples

Converting from streams to iostreams

A much older version of the C++ language used an earlier version of the input/output library called the streams library.

The iostream library is mostly upward compatible with this older stream library, but there are a few places where differences may affect programs. This subtopic discusses those differences. Unless you are maintaining C++ code that uses the old library, you need not read this subtopic.

The major conceptual difference is that in the iostream library, streams and streambufs are regarded solely as abstract classes. The old stream classes provided certain specialized behaviors, specifically incore formatting and file I/O. In the iostream library these are supported solely through derived classes.

The old stream library declared everything in the header file stream.h. The iostream library uses iostream.h and some other headers. For compatibility a stream.h is supplied that includes iostream.h and other headers that are required for compatibility and defines a variety of items whose names are different in the iostream and stream libraries.


Next topic: streambuf internals
Previous topic: Comparison of iostreams and stdio

© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 02 June 2005