-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcase_x.c
More file actions
30 lines (26 loc) · 1.18 KB
/
Copy pathcase_x.c
File metadata and controls
30 lines (26 loc) · 1.18 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* case_x.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: Cerdelen < cerdelen@student.42wolfsburg.de +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/12/04 20:11:46 by Cerdelen #+# #+# */
/* Updated: 2021/12/04 20:11:46 by Cerdelen ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
int print_hex(int i)
{
int counter;
if (i < 0)
i += 4294967296;
counter = 0;
if (i >= 16)
counter = print_hex(i / 16);
return (counter + write(1, &"0123456789abcdef"[i % 16], 1));
}
int case_x(va_list *args)
{
return (print_hex(va_arg(args));
}