-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_pointer.c
33 lines (30 loc) · 1.16 KB
/
ft_pointer.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
31
32
33
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_pointer.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: aeminian <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/02/11 14:47:44 by aeminian #+# #+# */
/* Updated: 2024/03/10 19:54:11 by aeminian ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
int ft_pointer(unsigned long long n)
{
int count;
char *symbols;
count = 0;
symbols = "0123456789abcdef";
if (n < 16)
{
count++;
ft_putchar(symbols[n]);
}
else
{
count = ft_pointer(n / 16);
return (count + ft_pointer(n % 16));
}
return (count);
}