# <iomanip> <iomanip> # `` * * * Include the [iostreams](https://docs.qualcomm.com/doc/80-N3040-23/topic/cpp_lib_cpp.html#iostreams) standard header **``** to define several [manipulators](https://docs.qualcomm.com/doc/80-N3040-23/topic/cpp_ios.html#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::operator>>` and `basic_ostream::operator<<`. Thus, you can write extractors and inserters such as: cin >> setbase(8); cout << setbase(8);Copy to clipboard namespace std { T1 resetiosflags(ios_base::fmtflags mask); T2 setiosflags(ios_base::fmtflags mask); T3 setbase(int base); template T4 setfill(Elem ch); T5 setprecision(streamsize prec); T6 setw(streamsize wide); } // namespace stdCopy to clipboard ## `resetiosflags` T1 resetiosflags(ios_base::fmtflags mask);Copy to clipboard 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);Copy to clipboard 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: - If `base` is 8, then `mask` is `ios_base::oct` - If `base` is 10, then `mask` is `ios_base::dec` - If `base` is 16, then `mask` is `ios_base::hex` - If `base` is any other value, then `mask` is `ios_base::fmtflags(0)` ## `setfill` template T4 setfill(Elem ch);Copy to clipboard The template manipulator returns an object that, when extracted from or inserted into the stream `str`, calls `str.fill(ch)`, then returns `str`. The type `Elem` must be the same as the element type for the stream `str`. ## `setiosflags` T2 setiosflags(ios_base::fmtflags mask);Copy to clipboard 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);Copy to clipboard 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);Copy to clipboard The manipulator returns an object that, when extracted from or inserted into the stream `str`, calls `str.width(wide)`, then returns `str`. * * * See also the **[Table of Contents](https://docs.qualcomm.com/doc/80-N3040-23/topic/cpp_index.html#Table%20of%20Contents)** and the **[Index](https://docs.qualcomm.com/doc/80-N3040-23/topic/_cpp_index.html)**. *[Copyright](https://docs.qualcomm.com/doc/80-N3040-23/topic/cpp_crit_pjp.html) © 1992-2006by P.J. Plauger. All rights reserved.* Last Published: Oct 06, 2026 Previous Topic Next Topic