O'Reilly logo

Just Enough C/C++ Programming by Guy W. Lecky-Thompson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Base Class Functionality

This section summarizes the base class functionality that is available to all classes derived from ios_stream. It includes formatting, manipulation, and exception-processing implemented as part of the C++ Standard IO Libraries.

Formatting

In addition to using manipulators in the stream, you can use flags that are contained in the definition of the streams library. These are set using the following member function:

ios_base::flags ( <collection of ios::flags> );

These flags offer the same possibilities as the manipulator switches and have the same names, but they can be combined to set a collection of flags at once. So you could write the following code, for example:

cout << showpoint << showpos << scientific << 42.42; ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required