|
hexmanipulator function
<ios> ios_base& hex ( ios_base& str ); Use hexadecimal base Sets the basefield format flag for the str stream to hex.When basefield is set to hex, integral numerical values inserted into the stream are expressed in the hexadecimal base (radix 16). For input streams, extracted values are also expected to be expressed in the hexadecimal base when this flag is set. The basefield format flag can take any of the following values (each with its own manipulator):
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. Parameters
Return ValueA reference to the stream object.Example
The execution of this example displays something similar to:
See also
|