strtoul() will convert from any base (2-36) to a standard integer.

cout can display a number in octal, decimal, or hex, and with a little help from <bitset> you can display in binary.

There isn't a standard built-in function to convert from a standard integer to any base. But if you have a Microsoft compiler, itoa() will do exactly that.

Note that any conversion is normally done only during input or output. The above functions convert between an integer and a C-style-string representation of the number in another base.

All variables in the computer's memory are stored in binary. C++ changes it to decimal input/output by default. This means that you can enter one number in decimal, another in hex, add them together, and display the result in octal, without worrying about the fact that you mixing bases!

Here's an example program I wrote a couple of years ago: