##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# Input/output manipulators

From cppreference.com
< cpp‎ | io

Manipulators are helper functions that make it possible to control input/output streams using operator<< or operator>>.

The manipulators that are invoked without arguments (e.g. std::cout << std::boolalpha; or std::cin >> std::hex;) are implemented as functions that take a reference to a stream as their only argument. The special overloads of `basic_ostream::operator<<` and `basic_istream::operator>>` accept pointers to these functions.

The manipulators that are invoked with arguments (e.g. std::cout << std::setw(10);) are implemented as functions returning objects of unspecified type. These manipulators define their own `operator<<` or `operator>>` which perform the requested manipulation.

Defined in header `<ios>`
boolalpha noboolalpha | switches between textual and numeric representation of booleans (function) [edit]
showbase noshowbase | controls whether prefix is used to indicate numeric base (function) [edit]
showpoint noshowpoint | controls whether decimal point is always included in floating-point representation (function) [edit]
showpos noshowpos | controls whether the `+` sign used with non-negative numbers (function) [edit]
skipws noskipws | controls whether leading whitespace is skipped on input (function) [edit]
uppercase nouppercase | controls whether uppercase characters are used with some output formats (function) [edit]
unitbuf nounitbuf | controls whether output is flushed after each operation (function) [edit]
internal left right | sets the placement of fill characters (function) [edit]
dec hex oct | changes the base used for integer I/O (function) [edit]
fixed scientific hexfloat defaultfloat (C++11)(C++11) | changes formatting used for floating-point I/O (function) [edit]
Defined in header `<istream>`
ws | consumes whitespace (function template) [edit]
Defined in header `<ostream>`
ends | outputs '\0' (function template) [edit]
flush | flushes the output stream (function template) [edit]
endl | outputs '\n' and flushes the output stream (function template) [edit]
Defined in header `<iomanip>`
resetiosflags | clears the specified ios_base flags (function) [edit]
setiosflags | sets the specified ios_base flags (function) [edit]
setbase | changes the base used for integer I/O (function) [edit]
setfill | changes the fill character (function template) [edit]
setprecision | changes floating-point precision (function) [edit]
setw | changes the width of the next input/output field (function) [edit]
get_money (C++11) | parses a monetary value (function template) [edit]
put_money (C++11) | formats and outputs a monetary value (function template) [edit]
get_time (C++11) | parses a date/time value of specified format (function template) [edit]
put_time (C++11) | formats and outputs a date/time value according to the specified format (function template) [edit]
quoted (C++14) | inserts and extracts quoted strings with embedded spaces (function template) [edit]

Retrieved from "http://en.cppreference.com/mwiki/index.php?title=cpp/io/manip&oldid=57896"