I want to write a small big integer library using grammer school methods !
I am facing a problem with the representation and printing .

First a string is to be converted into an array of digits .. assume base is 10^4
so 12345678999 will be represented as

arr[0]=9998;
arr[1]=7654;
arr[2]=321;

but for some numbers such as 10000000 it will be
arr[0]=0;
arr[1]=1;

Now the main problem is with printing a bignum .. to print the first example ..i have to break each number using '%' operator so as to get 12345678999 ..which i think will make it slow !
and also extra care should be taken while printing the second case ... or else i'll end up showing 10

Any help ?