mirror of
https://github.com/Ladebeze66/Piscine42.git
synced 2025-12-16 05:58:07 +01:00
35 lines
1.1 KiB
C
Executable File
35 lines
1.1 KiB
C
Executable File
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* ft_str_is_numeric.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: fgras-ca <marvin@42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2022/12/07 17:46:52 by fgras-ca #+# #+# */
|
|
/* Updated: 2022/12/10 17:06:15 by fgras-ca ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
int ft_str_is_numeric(char *str)
|
|
{
|
|
int i;
|
|
|
|
i = 0;
|
|
if (str[i] == '\0')
|
|
{
|
|
return (1);
|
|
}
|
|
while (str[i] != '\0')
|
|
{
|
|
if ((str[i] >= 48 && str[i] <= 57))
|
|
{
|
|
i++;
|
|
}
|
|
else
|
|
{
|
|
return (0);
|
|
}
|
|
}
|
|
return (1);
|
|
}
|