Name

setbase function — Sets conversion radix

Synopsis

                  manip_t 
                  setbase(int base)

The setbase function sets the conversion radix for a stream. In other words, it performs the equivalent of stream .setf( newbase, ios_base::basefield), in which newbase depends on base, as shown in Table 13-11. Notice that any value of a base other than 8, 10, or 16 is treated the same as 0.

Table 13-11. Conversion radix

setbase argument

fmtflags equivalent

8

ios_base::oct

10

ios_base::dec

16

ios_base::hex

Anything else

0

See Also

ios_base in <ios>

Get C++ In a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.