-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathft_convert_base.c
22 lines (19 loc) · 1.1 KB
/
ft_convert_base.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_convert_base.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gamarcha <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/05/04 23:12:59 by gamarcha #+# #+# */
/* Updated: 2021/06/03 13:18:35 by gamarcha ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char *ft_convert_base(
const char *str, const char *base_from, const char *base_to)
{
int nb;
nb = ft_atoi_base(str, base_from, ft_strlen(base_from));
return (ft_itoa_base(nb, base_to, ft_strlen(base_to)));
}