26 lines
1.1 KiB
C
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);
|
|
}
|