25 lines
1.1 KiB
C
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);
|
|
}
|