Partager via


Input Stream Manipulators

 

The latest version of this topic can be found at Input Stream Manipulators.

Many manipulators, such as [setprecision]--brokenlink--(../Topic/not%20found:3ddde610-70cc-4cfa-8a89-3e83d1d356a8.md#setprecision), are defined for the ios class and thus apply to input streams. Few manipulators, however, actually affect input stream objects. Of those that do, the most important are the radix manipulators, dec, oct, and hex, which determine the conversion base used with numbers from the input stream.

On extraction, the hex manipulator enables processing of various input formats. For example, c, C, 0xc, 0xC, 0Xc, and 0XC are all interpreted as the decimal integer 12. Any character other than 0 through 9, A through F, a through f, x, and X terminates the numeric conversion. Thus the sequence "124n5" is converted to the number 124 with the basic_ios::fail bit set.

See Also

Input Streams