This is often made much more confusing than it need be... Unless you are taking a math class where you must directly convert between radices, in the computer you can usually think of it this way:
"base" or "radix" is something that humans need when they write a number.
a number itself is just a number (even in the computer).
So the thing you must do is implement two functions: one to convert a human readable "number" (or string of digits) to a computer's number, and another to convert a computer number to a human readable "number" (a text string).
So, the process is like this:
0A (hex) --> ten (in the computer) --> 12 (oct)
How it is actually stored in the computer is unimportant, because the computer treats it as a number for you.
Now, the important operations to taking a number apart are integer division and remainder:
12%10 = 2
12/10 = 1
And the important operations to putting a number together are multiplication and addition:
1*10 + 2 = 12
In these examples, 10 is the radix (or "base").
The last thing to remember is that 1 != '1'. In C and C++, the number 1 is an unprintable character. The character '1' has a big number. Convert between the number and the human readable text digits using some addition:
I hope I'm not giving you the total solution (Well the containers aren't standard at least). But I was working on a project with these functions last night. This is half of it. Just do the reverse to get strings from unsigned int.