Namespaces
Variants
Actions

std::ios_base::flags

From cppreference.com
< cpp‎ | io‎ | ios base
 
 
 
 
fmtflags flags() const;
(1)
fmtflags flags( fmtflags flags );
(2)

Manages format flags.

1) returns current formatting setting
2) replaces current settings with given ones.

Contents

[edit] Parameters

flags-new formatting setting. It can be a combination of formatting flags constants.


[edit] Formatting flags
ConstantExplanation
decuse decimal base for integer I/O: see std::dec
octuse octal base for integer I/O: see std::oct
hexuse hexadecimal base for integer I/O: see std::hex
basefielddec | oct | hex. Useful for masking operations
leftleft adjustment (adds fill characters to the right): see std::left
rightright adjustment (adds fill characters to the left): see std::right
internalinternal adjustment (adds fill characters to the internal designated point): see std::internal
adjustfieldleft | right | internal. Useful for masking operations
scientificgenerate floating point types using scientific notation, or hex notation if combined with fixed: see std::scientific
fixedgenerate floating point types using fixed notation, or hex notation if combined with scientific: see std::fixed
floatfieldscientific | fixed. Useful for masking operations
boolalphainsert and extract bool type in alphanumeric format: see std::boolalpha
showbasegenerate a prefix indicating the numeric base for integer output, require the currency indicator in monetary I/O: see std::showbase
showpointgenerate a decimal-point character unconditionally for floating-point number output: see std::showpoint
showposgenerate a + character for non-negative numeric output: see std::showpos
skipwsskip leading whitespace before certain input operations: see std::skipws
unitbufflush the output after each output operation: see std::unitbuf
uppercasereplace certain lowercase letters with their uppercase equivalents in certain output operations: see std::uppercase

[edit] Return value

the formatting flags before the call to the function

[edit] Example

[edit] See also

sets specific format flag
(public member function) [edit]
clears specific format flag
(public member function) [edit]