Type fmtflags

An enumeration used to set various formatting flags for reading and writing of streams.

Table 1. Format Flags Enumerations
Flag Effects when set
boolalpha insert or extract bool type in alphabetic form
dec decimal output
fixed when set shows floating point numbers in normal manner, six decimal places is default
hex hexadecimal output
oct octal output
left left justified
right right justified
internal pad a field between signs or base characters
scientific show scientific notation for floating point numbers
showbase shows the bases numeric values
showpoint shows the decimal point and trailing zeros
showpos shows the leading plus sign for positive numbers
skipws skip leading white spaces with input
unitbuf buffer the output and flush after insertion operation
uppercase show the scientific notation, x or o in uppercase
Table 2. Format flag field constants
Constants Allowable values
adjustfield left | right | internal
basefield dec | oct | hex
floatfield scientific | fixed
Listing: Example of ios format flags usage

see basic_ios::setf() and basic_ios::unsetf()