42/d03/ex08/ft_atoi.c

25 lines
1,023 B
C
Raw Normal View History

2016-11-20 02:20:23 +02:00
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_atoi.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gtertysh <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/10/28 12:27:05 by gtertysh #+# #+# */
/* Updated: 2016/10/28 21:02:24 by gtertysh ### ########.fr */
/* */
/* ************************************************************************** */
int ft_atoi(char *p)
{
int numb;
numb = 0;
while (*p != '\0')
{
numb = numb * 10 + (*p) - '0';
p++;
}
return (numb);
}