42_push_swap/ft_isnum.c
Camille Chauvet bb6e9ddd85 d
2022-11-23 21:44:27 +01:00

25 lines
1.1 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_isnum.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cchauvet <cchauvet@student.42angouleme.fr +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/11/08 18:43:06 by cchauvet #+# #+# */
/* Updated: 2022/11/08 19:52:48 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
#include "pushswap.h"
int ft_isnum(char *str)
{
while (*str != '\0')
{
if (!((*str >= '0' && *str <= '9') || *str == '-' || *str == '+'))
return (0);
str++;
}
return (1);
}