DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

iomanip(C++std)


resetiosflags , setbase , setfill , setiosflags , setprecision , setw - defines several iostreams manipulators that take an argument

Synopsis

   namespace std {
   T1 resetiosflags(ios_base::fmtflags mask);
   T2 setiosflags(ios_base::fmtflags mask);
   T3 setbase(int base);
   template<class E>
       T4 setfill(E c);
   T5 setprecision(streamsize n);
   T6 setw(streamsize n);
       };

Include the iostreams standard header <iomanip> to define several manipulators that each take a single argument. Each of these manipulators returns an unspecified type, called T1 through T6 here, that overloads both basic_istream<E, T>::operator>> and basic_ostream<E, T>::operator<<. Thus, you can write extractors and inserters such as:

   cin >> setbase(8);
   cout << setbase(8);

resetiosflags

   T1 resetiosflags(ios_base::fmtflags mask);

The manipulator returns an object that, when extracted from or inserted into the stream str, calls str.setf(ios_base:: fmtflags(), mask), then returns str.

setbase

   T3 setbase(int base);

The manipulator returns an object that, when extracted from or inserted into the stream str, calls str.setf(mask, ios_base::basefield), then returns str. Here, mask is determined as follows:

setfill

   template<class E>
       T4 setfill(E fillch);

The template manipulator returns an object that, when extracted from or inserted into the stream str, calls str.fill(fillch), then returns str. The type E must be the same as the element type for the stream str.

setiosflags

   T2 setiosflags(ios_base::fmtflags mask);

The manipulator returns an object that, when extracted from or inserted into the stream str, calls str.setf(mask), then returns str.

setprecision

   T5 setprecision(streamsize prec);

The manipulator returns an object that, when extracted from or inserted into the stream str, calls str.precision(prec), then returns str.

setw

   T6 setw(streamsize wide);

The manipulator returns an object that, when extracted from or inserted into the stream str, calls str.width(wide), then returns str.

References

ios(C++std) , istream(C++std) , ostream(C++std)
18 February 2000
© 2000 The Santa Cruz Operation, Inc. All rights reserved.

Copyright © 1992-1996 by P.J. Plauger. Portions derived from work copyright © 1994 by Hewlett-Packard Company. All rights reserved.