-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_putptr.c
30 lines (27 loc) · 1.11 KB
/
ft_putptr.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
28
29
30
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_putptr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ayhamdou <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/11/26 17:54:41 by ayhamdou #+# #+# */
/* Updated: 2023/11/26 18:13:18 by ayhamdou ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
int ft_putptr(unsigned long n)
{
int len;
char *hex;
len = 0;
hex = "0123456789abcdef";
if (n >= 16)
{
len += ft_putptr(n / 16);
len += ft_putptr(n % 16);
}
else
len += ft_putchar(hex[n]);
return (len);
}