1. I don't understand. If I have a number for instance 10000000100 and the base 100000 I will have [100000][100] but I should have something like [100000][00100], right ? But I have those first two zeros lost. I can introduce for example one more extra variable which would keep the number of leading zeros - in this case 2, but maybe there is some other way of solving it without any other variable ?
--
Regards,
apacz.

2. If I have a number for instance 10000000100 and the base 100000 I will have [100000][100] but I should have something like [100000][00100], right ? But I have those first two zeros lost. I can introduce for example one more extra variable which would keep the number of leading zeros - in this case 2, but maybe there is some other way of solving it without any other variable ?
Set the required width(), and set the fill() character to '0', and ensure that your output is right justified.

3. Fill the digits into a temporary buffer (eg. std::stringstream), then do iomanip-ulation (post above), then return as std::string. Most flexible.

4. Originally Posted by n3v
there's another clever little system you can use. it's called a 'letter array'. put the number into a char array, but with a really high uh.. whats the word.. ah, a really high number base. for example, our normal counting has base 10, and hexidecimal has 15, and binary has 1. that means, when the amount of the number gets to that point, it adds on another place holder. for example, here's some numbers written with different bases:
You Twit, everyone knows that hexadecimal is base 16 and binary is base 2!

To the OP: If you don't want to perform any mathematical operations on them then you don't need a big number library, at least not in the usual sense. Just store them as strings and be done with it. In other words, base 256 will be just fine.

5. Hi,
Ok, now I know how to deal with it. I just haven't realized that if the number is >15 digits long then in the 'b' there will be always 15 digits so it's easy to calculate the number of leading zeros even without the visible represenation of them. Thanks for the help,
--
Regards,
apacz.