-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_print_pointer.c
28 lines (26 loc) · 1.15 KB
/
ft_print_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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_print_pointer.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: skarras <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/11/18 08:44:09 by skarras #+# #+# */
/* Updated: 2024/11/18 08:44:11 by skarras ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
int print_pointer(unsigned long nb, int count)
{
if (nb == 0)
return (0);
if (nb != 0)
{
count += print_pointer(nb / 16, count);
if (nb % 16 <= 9)
count += print_char(nb % 16 + '0');
else
count += print_char(nb % 16 + 'W');
}
return (count);
}