-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_printptr.c
25 lines (22 loc) · 1.09 KB
/
ft_printptr.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_printptr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: daxferab <[email protected] +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/18 02:14:27 by daxferab #+# #+# */
/* Updated: 2024/05/24 17:33:34 by daxferab ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
int ft_printptr(size_t ptr)
{
int bytes;
bytes = 0;
if (ptr == 0)
return (write(1, "(nil)", 5));
bytes += write(1, "0x", 2);
bytes += ft_printhex(ptr, "0123456789abcdef");
return (bytes);
}