Assuming you have the following function:
int64_t divideRem(struct int128 *number, int64_t divisor);
That divides number / divisor, setting the division result on number, and returns the remainder of the division.
You could use a recursive implementation:
printInt128rec(struct int128 *number) {
int64_t rem;
rem = divideRem(number, 10);
if( cmpInt128(number, 0) != 0 ) { /* compares number with 0 */
printInt128rec(number);
}
printf("%d", rem);
}
Your main print function should copy the number to avoid modifications, and check for negatives:
printInt128(struct int128 *number) {
struct int128 copy = *number;
if( cmpInt128(©, 0) < 0 ) { /* number is negative */
printf("-");
becomePositive(©); /* copy = abs (number ) */
}
printInt128rec(©);
}
Now you may call printInt128 to print your numbers. Notice that I used several other functions that operates between an int128 integer and an int64. If you know how to make 128 bits arithmetics these should be easier to implement.