I always think of base one like this:
Position n is worth 1^n = 1, so every position is equally worth.
1=1
2=11
3=111
4=1111
...
This isn't 100% consistent with the other bases as you have to drop the zero.
Also, non-integers are hard to represent like this.
EDIT:
As for the conversion, I'm quite sure I've posted such code here before. Do a board search and I'm sure you'll encounter code by me or someone else.
Here's how it could look like:
Code:
string num2str(unsigned num, unsigned base)
{
const char digits['0','1',...'9','A',...'Ö']; //the digits we will use to build the number
string output;
while (num > 0)
{
output = output + digits[num%base];
num /= base;
}
return output;
}
Add some error checking and it should work.