ft_str_is_numeric.c

This commit is contained in:
Timo Schmidt 2023-03-19 11:12:10 +01:00
parent b68ced862c
commit 051459b33a
1 changed files with 34 additions and 0 deletions

34
ex03/ft_str_is_numeric.c Normal file
View File

@ -0,0 +1,34 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_str_is_numeric.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tischmid <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/03/19 10:33:26 by tischmid #+# #+# */
/* Updated: 2023/03/19 11:04:24 by tischmid ### ########.fr */
/* */
/* ************************************************************************** */
int ft_str_is_numeric(char *str)
{
int i;
i = 0;
while (str[i] >= '0' && str[i] <= '9')
{
++i;
}
return (str[i] == '\0');
}
/* ////
#include <stdio.h>
int main(void)
{
char s[] = "";
printf("%d\n", ft_str_is_numeric(s));
return (0);
}
*/ ////