narnaud
3 years ago
5 changed files with 41 additions and 8 deletions
@ -0,0 +1,26 @@ |
|||||
|
/* ************************************************************************** */ |
||||
|
/* */ |
||||
|
/* ::: :::::::: */ |
||||
|
/* ft_isnumber.c :+: :+: :+: */ |
||||
|
/* +:+ +:+ +:+ */ |
||||
|
/* By: narnaud@student.42nice.fr <marvin@42.fr> +#+ +:+ +#+ */ |
||||
|
/* +#+#+#+#+#+ +#+ */ |
||||
|
/* Created: 2022/05/18 16:18:15 by narnaud@stude #+# #+# */ |
||||
|
/* Updated: 2022/05/18 16:21:52 by narnaud@stude ### ########.fr */ |
||||
|
/* */ |
||||
|
/* ************************************************************************** */ |
||||
|
|
||||
|
#include "../libft.h" |
||||
|
|
||||
|
int ft_isnumber(char *str) |
||||
|
{ |
||||
|
if (*str == '-' || *str == '+') |
||||
|
str++; |
||||
|
while (*str) |
||||
|
{ |
||||
|
if (!ft_isdigit(*str)) |
||||
|
return (0); |
||||
|
str++; |
||||
|
} |
||||
|
return (1); |
||||
|
} |
Loading…
Reference in new issue