When basefield is set to oct, integral numerical values inserted into the stream are expressed in the octal base (radix 8). For input streams, extracted values are also expected to be expressed in the octal base when this flag is set.
The basefield format flag can take any of the following values (each with its own manipulator):
|flag value||effect when set|
|dec||read/write integral values using decimal base format.|
|hex||read/write integral values using hexadecimal base format.|
|oct||read/write integral values using octal base format.|
The basefield flag is set to dec in standard streams on initialization.
Notice that the basefield flag only affects the insertion/extraction of integer values. Floating-point values are always treated in the decimal base.
Notice also that no base prefix is implicitly prepended to the number unless the showbase format flag is set.
- Stream object where to apply.
Because this function is a manipulator, it is designed to be used alone with no arguments in conjunction with the insertion (<<) and extraction (>>) operations on streams (see example below).
Return ValueA reference to the stream object.
The execution of this example displays something similar to:
106 70 46
|dec||Use decimal base (manipulator function)|
|hex||Use hexadecimal base (manipulator function)|
|ios_base::flags||Get/set format flags (public member function)|
|ios_base::setf||Set specific format flags (public member function)|