-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_puthex.c
24 lines (21 loc) · 1.03 KB
/
ft_puthex.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_puthex.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: bdomansk <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/04/06 10:08:29 by bdomansk #+# #+# */
/* Updated: 2018/04/06 10:08:31 by bdomansk ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_puthex(int n)
{
char *str;
str = ft_itoa_base(n, 16);
if (n > 0)
write(1, "0x", 2);
write(1, str, ft_strlen(str));
free(str);
}