-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_printadd.c
28 lines (25 loc) · 1.15 KB
/
ft_printadd.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_printadd.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: yel-aoun <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/11/29 15:03:11 by yel-aoun #+# #+# */
/* Updated: 2021/12/02 19:13:52 by yel-aoun ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
static void ft_print_add(unsigned long long k)
{
if (k >= 16)
ft_print_add(k / 16);
ft_printchar("0123456789abcdef"[k % 16]);
}
int ft_printadd(unsigned long long k)
{
ft_printchar('0');
ft_printchar('x');
ft_print_add(k);
return (ft_cal_hexa(k) + 2);
}