Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void pnbr_base(long nb, char const *base)
- {
- int base_len = my_strlen(base);
- if (nb) {
- pnbr_base(nb / base_len, base);
- my_putchar(base[nb % base_len]);
- }
- }
- int my_put_nbr_base(long nb, char const *base)
- {
- if (nb < 0) {
- my_putchar('-');
- nb = -nb;
- }
- if (nb != 0)
- pnbr_base(nb, base);
- else
- my_putchar(base[nb]);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement