-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_print_point.c
More file actions
37 lines (33 loc) · 1.28 KB
/
Copy pathft_print_point.c
File metadata and controls
37 lines (33 loc) · 1.28 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
32
33
34
35
36
37
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_print_ponit.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: danrodr3 <danrodr3@students.42madrid.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/11/05 17:51:34 by danrodr3 #+# #+# */
/* Updated: 2025/11/05 17:51:34 by danrodr3 ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
static int print_hex(uintptr_t pont)
{
int count;
count = 0;
if (pont >= 16)
count += print_hex(pont / 16);
count += ft_print_char("0123456789abcdef"[pont % 16]);
return (count);
}
int ft_print_point(void *point)
{
int i;
uintptr_t pont;
i = 0;
if (!point)
return (ft_printstr("(nil)"));
pont = (uintptr_t) point;
i += ft_printstr("0x");
i += print_hex(pont);
return (i);
}