-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_putnbr_base.c
27 lines (24 loc) · 1.11 KB
/
ft_putnbr_base.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/* ************************************************************************** */
/* */
/* :::::::: */
/* ft_putnbr_base.c :+: :+: */
/* +:+ */
/* By: abobas <abobas@student.codam.nl> +#+ */
/* +#+ */
/* Created: 2020/05/15 21:30:52 by abobas #+# #+# */
/* Updated: 2020/05/16 00:25:25 by abobas ######## odam.nl */
/* */
/* ************************************************************************** */
#include "includes/libft.h"
void ft_putnbr_base(int n, int base)
{
char *radix;
radix = "0123456789abcdef";
if (n >= base)
{
ft_putnbr_base(n / base, base);
ft_putnbr_base(n % base, base);
}
else
ft_putchar(radix[n % base]);
}