-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_hexadecimal.c
More file actions
30 lines (27 loc) · 1.22 KB
/
ft_hexadecimal.c
File metadata and controls
30 lines (27 loc) · 1.22 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_hexadecimal.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: fulloa-s <fulloa-s@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/02/06 13:26:50 by fulloa-s #+# #+# */
/* Updated: 2021/02/09 11:04:49 by fulloa-s ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
void ft_hexadecimal(va_list args, t_list *list)
{
char *str_numb;
int x;
x = va_arg(args, size_t);
if (x == 0)
list->num_0 = 1;
if (list->type == 'X')
str_numb = ft_itoa_base((unsigned int)x, BASE16);
else
str_numb = ft_itoa_base((unsigned int)x, BASE16U);
list->type = 'd';
ft_putstr(str_numb, list);
free(str_numb);
}