Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Manipulators

All the manipulators are defined as an enumeration in class(ios). They


uses <iomanip> header file

dec Format integer values as base 10(decimal). This is default


representation

hex Format integer values as base 16(hexadecimal).

oct Format integer values as base 8 (octal)

left Left –align values in the output field, and pad them on the right
with fill character. The default fill character is a space.

right Right align values in the output field, and pad them on the left
with the fill character.

fixed Output floating point values in fixed point notation with specific
number of digits to the right of decimal point

scientific Output floating point values in scientific notation


showpoint Shows the decimal point and trailing zeros for floating point
values

noshowpoint Opposite of above

showbase Prefix octal output with 0 (zero) and hexadecimal output with
0x or 0X

noshowbase Show hexadecimal and octal without the prefix. This is


default

internal Indicates that a number’s sign should be left justified and


numbers magnitude should be right justified in the same
field. Padding characters appear between the sign and the
number

showpos Shows plus sign + for positive values

noshowpos Do not show plus sign . This is default


uppercase Display upper case A through F for hexadecimal digits
when outputting integers in hexadecimal format, 0X if
showbase is set. Display E for the exponent when
outputting values in scientific notation, rather than lower
case e

nouppercase opposite of above. This is default

skipws Skips whitespace characters on an input stream

boolalpha Display bool values as true or false

noboolalpha Display bool values as 1 or 0. This is default

You might also like