-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_hexconvert_lower.c
More file actions
34 lines (31 loc) · 1.2 KB
/
Copy pathft_hexconvert_lower.c
File metadata and controls
34 lines (31 loc) · 1.2 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
26
27
28
29
30
31
32
33
34
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_hexconvert_lower.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mmeier <mmeier@student.hive.fi> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/12/11 15:46:14 by mmeier #+# #+# */
/* Updated: 2023/12/15 16:13:27 by mmeier ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
int ft_hexconvert_lower(unsigned long long int n, int *cmp)
{
int count;
count = 0;
if (n >= 16)
{
count += ft_hexconvert_lower((n / 16), cmp);
n = n % 16;
}
if (n >= 10)
{
count += ft_putchar_count('a' + (n - 10), cmp);
}
else
{
count += ft_putchar_count(('0' + n), cmp);
}
return (count);
}