-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_putptr.c
More file actions
31 lines (28 loc) · 1.1 KB
/
ft_putptr.c
File metadata and controls
31 lines (28 loc) · 1.1 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_putptr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: slargo-b <slargo-b@student.42madrid.com +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/02/03 12:28:07 by slargo-b #+# #+# */
/* Updated: 2025/02/07 15:25:12 by slargo-b ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
int ft_putptr(void *ptr)
{
int len;
len = 0;
if (!ptr)
{
len = ft_putstr("(nil)");
return (len);
}
else
{
len += write(1, "0x", 2);
len += ft_puthex((unsigned long)ptr, 'p');
}
return (len);
}