28 lines
1.0 KiB
C
28 lines
1.0 KiB
C
|
/* ************************************************************************** */
|
||
|
/* */
|
||
|
/* ::: :::::::: */
|
||
|
/* ft_isnum.c :+: :+: :+: */
|
||
|
/* +:+ +:+ +:+ */
|
||
|
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
|
||
|
/* +#+#+#+#+#+ +#+ */
|
||
|
/* Created: 2023/03/08 14:43:33 by cchauvet #+# #+# */
|
||
|
/* Updated: 2023/04/11 14:47:30 by cchauvet ### ########.fr */
|
||
|
/* */
|
||
|
/* ************************************************************************** */
|
||
|
|
||
|
#include "../philo.h"
|
||
|
|
||
|
bool ft_isnum(char str[])
|
||
|
{
|
||
|
size_t i;
|
||
|
|
||
|
i = 0;
|
||
|
while (str[i] != '\0')
|
||
|
{
|
||
|
if (str[i] > '9' || str[i] < '0')
|
||
|
return (0);
|
||
|
i++;
|
||
|
}
|
||
|
return (1);
|
||
|
}
|