42_C_PISCINE/BSQ/ft_atou.c
Camille Chauvet 29ed24d567 init
2023-05-17 16:45:25 +00:00

24 lines
1.0 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_atou.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/08/02 10:37:25 by cchauvet #+# #+# */
/* Updated: 2022/08/02 10:37:52 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
unsigned int ft_atou(char *str)
{
int i;
unsigned int base;
i = 0;
base = 0;
while ('0' <= str[i] && str[i] <= '9')
base = base * 10 + (str[i++] - '0');
return (base);
}