-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_convbase_x.c
More file actions
30 lines (27 loc) · 1.14 KB
/
Copy pathft_convbase_x.c
File metadata and controls
30 lines (27 loc) · 1.14 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_convbase_x.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: lkazaz <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/11/19 05:57:49 by lkazaz #+# #+# */
/* Updated: 2023/11/21 13:20:21 by lkazaz ### ########.fr */
/* */
/* ************************************************************************** */
#include"ft_printf.h"
int ft_convbase_x(unsigned int n)
{
char *base;
int count;
count = 0;
base = "0123456789abcdef";
if (n >= 16)
{
count += ft_convbase_x(n / 16);
count += ft_putchar(base[n % 16]);
}
else
count += ft_putchar(base[n]);
return (count);
}