-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_int_to_hex_lowercase.c
More file actions
25 lines (22 loc) · 1.13 KB
/
ft_int_to_hex_lowercase.c
File metadata and controls
25 lines (22 loc) · 1.13 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_int_to_hex_lowercase.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mraineri <mraineri@student.42lisboa.com +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/08/10 19:22:03 by mraineri #+# #+# */
/* Updated: 2024/09/09 13:25:28 by mraineri ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
void ft_int_to_hex_lowercase(unsigned int decimal, int *counter)
{
char *hex;
hex = "0123456789abcdef";
if (decimal >= 16)
ft_int_to_hex_lowercase(decimal / 16, counter);
write(1, &hex[decimal % 16], 1);
if (counter)
(*counter)++
}