-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_puthexa_low.c
32 lines (29 loc) · 1.13 KB
/
ft_puthexa_low.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_puthexa_low.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: azaher <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/10/31 14:59:42 by azaher #+# #+# */
/* Updated: 2022/10/31 16:43:54 by azaher ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
int ft_puthexa_low(unsigned int n)
{
int i;
char *lowbase;
i = 0;
lowbase = "0123456789abcdef";
if (n > 15)
{
i += ft_puthexa_low(n / 16);
i += ft_puthexa_low(n % 16);
}
else
{
i += ft_putchar(lowbase[n]);
}
return (i);
}