-
Notifications
You must be signed in to change notification settings - Fork 0
/
print_ptr.c
39 lines (32 loc) · 1.26 KB
/
print_ptr.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
34
35
36
37
38
39
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* print_ptr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: sde-silv <sde-silv@student.42berlin.de> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/07/12 17:04:46 by sde-silv #+# #+# */
/* Updated: 2023/07/12 18:18:04 by sde-silv ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
#ifdef __linux__
int print_ptr(unsigned long int next, int format)
{
int digits;
if (next == 0)
return (print_str("(nil)"));
else
{
digits = write (1, "0x", 2);
return (digits + print_hex(next, format));
}
}
#else
int print_ptr(unsigned long int next, int format)
{
int digits;
digits = write (1, "0x", 2);
return (digits + print_hex(next, format));
}
#endif