You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
1.0 KiB
26 lines
1.0 KiB
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* 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);
|
|
}
|
|
|