-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_printptrhex.c
More file actions
31 lines (28 loc) · 1.11 KB
/
Copy pathft_printptrhex.c
File metadata and controls
31 lines (28 loc) · 1.11 KB
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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_printptrhex.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: abali <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/01/26 15:59:21 by abali #+# #+# */
/* Updated: 2023/01/26 16:00:11 by abali ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
int ft_printptrhex(unsigned long long ptr)
{
int count;
count = 0;
if (ptr == 0)
{
write(1, "0x0", 3);
count = 3;
}
else
{
write(1, "0x", 2);
count = 2 + ft_printnbrhex(ptr, 'x');
}
return (count);
}