42_C_PISCINE/Rush/Rush02/ex00/ft_atoi.c
Camille Chauvet 29ed24d567 init
2023-05-17 16:45:25 +00:00

26 lines
1.1 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_atoi.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: nlauvray <nlauvray@student.42angoulem +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/07/31 08:31:20 by nlauvray #+# #+# */
/* Updated: 2022/07/31 11:15:12 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
#include "rush02.h"
unsigned int ft_atoi(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);
}