diff --git a/srcs/ft_putaddr.c b/srcs/ft_putaddr.c new file mode 100644 index 0000000..4c66ce0 --- /dev/null +++ b/srcs/ft_putaddr.c @@ -0,0 +1,12 @@ +#include "libft.h" + +int ft_putaddr(unsigned long n) +{ + int count = 0; + char *digits = "0123456789abcdef"; + + if (n >= 16) + count += ft_putaddr(n / 16); + count += ft_putchar(digits[n % 16]); + return count; +} \ No newline at end of file