[Edited for a big fix: thanks to Richard (see its comment) ;P ]
5 digits could be up to 99999,
which in binary is 1 followed by 99999 zeroes and 2^99999 in binary is 2 followed by 99999 zeroes: is a very huge number, in decimal is about 4.995e+30102! 100000 bit requires 12500 bytes!
There are libraries able to deal with number of these sizes, and they are used for example in
asymmetric-cryptography, like in the
RSA algorithm.
If you are interested in them, you could google for "bigint + C++":
http://www.google.it/search?hl=it&source=hp&q=bigint+%2B+c%2B%2B&cts=1281104483843&aq=f&aqi=g1&aql=&oq=&gs_rfai=[
^]