-
Notifications
You must be signed in to change notification settings - Fork 0
/
print_hexa_lower.c
30 lines (27 loc) · 1.14 KB
/
print_hexa_lower.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* print_hexa_lower.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: alouzizi <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/11/23 17:46:35 by alouzizi #+# #+# */
/* Updated: 2021/11/24 18:01:40 by alouzizi ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
void print_hexa_lower(unsigned long hexa, int *len)
{
char *base;
base = "0123456789abcdef";
if (hexa <= 15)
{
ft_putchar(base[hexa]);
(*len)++;
}
if (hexa > 15)
{
print_hexa_lower(hexa / 16, len);
print_hexa_lower(hexa % 16, len);
}
}