42_push_swap/ft_isnum.c

25 lines
1.1 KiB
C
Raw Normal View History

2022-11-23 15:44:27 -05:00
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* 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);
}