Input/output manipulators

From Cppreference

< cpp | io
Jump to: navigation, search

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

This is implemented as additional overloads of basic_ostream::operator<< and basic_istream::operator>> that accept a pointer to a function accepting a reference to a stream as a parameter.

Defined in header <ios>
boolalpha
noboolalpha
switches between textual and numeric representation of booleans
(function)
showbase
noshowbase
controls whether prefix is used to indicate numeric base
(function)
showpoint
noshowpoint
controls whether decimal point is always included in floating-point representation
(function)
snowpos
noshowpos
controls whether the + sign used with non-negative numbers
(function)
skipws
noskipws
controls whether leading whitespace is skipped on input
(function)
uppercase
nouppercase
controls whether uppercase characters are used with some output formats
(function)
unitbuf
nounitbuf
controls whether output is flushed after each operation
(function)
internal
left
right
sets the placement of fill characters
(function)
dec
hex
oct
changes the base used for integer I/O
(function)
fixed
scientific
hexfloat
defaultfloat


(C++11)
(C++11)
changes formatting used for floating-point I/O
(function)
Defined in header <istream>
ws
consumes whitespace
(function template)
Defined in header <ostream>
ends
outputs '\0'
(function template)
flush
flushes the output stream
(function template)
endl
outputs '\n' and flushes the output stream
(function template)
Defined in header <iomanip>
resetiosflags
clears the specified ios_base flags
(function)
setiosflags
sets the specified ios_base flags
(function)
setbase
change the base used for integer I/O
(function)
setfill
change fill character
(function)
setprecision
change floating-point precision
(function)
setw
change the width of the next output
(function)
get_money (C++11)
parses a monetary value
(function template)
put_money (C++11)
formats and outputs a monetary value
(function template)
get_time (C++11)
parses a date/time value of specified format
(function template)
put_time (C++11)
formats and outputs a date/time value according to the specified format
(function template)