-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_ptoa.c
26 lines (23 loc) · 1.11 KB
/
ft_ptoa.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_ptoa.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jovicto2 <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/07/06 18:17:43 by jovicto2 #+# #+# */
/* Updated: 2023/07/06 18:17:45 by jovicto2 ### ########.fr */
/* */
/* ************************************************************************** */
#include "../includes/libft.h"
char *ft_ptoa(size_t nbr)
{
char *string;
char *temp;
if (!nbr)
return (ft_strdup(NULL_POINTER));
temp = ft_itoa_hex(nbr, 16, LOWER_HEXAS);
string = ft_strjoin("0x", temp);
free(temp);
return (string);
}