init
This commit is contained in:
35
Correction/thellego/ex03/ft_str_is_numeric.c
Normal file
35
Correction/thellego/ex03/ft_str_is_numeric.c
Normal file
@ -0,0 +1,35 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_str_is_numeric.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: thellego <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2022/07/17 10:43:58 by thellego #+# #+# */
|
||||
/* Updated: 2022/07/17 10:54:48 by thellego ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
int ft_str_is_numeric(char *str)
|
||||
{
|
||||
int counter;
|
||||
|
||||
counter = 0;
|
||||
while (str[counter])
|
||||
{
|
||||
if (48 <= str[counter] && str[counter] <= 57)
|
||||
{
|
||||
counter++;
|
||||
}
|
||||
else
|
||||
{
|
||||
return (0);
|
||||
}
|
||||
}
|
||||
return (1);
|
||||
}
|
||||
/* int main()
|
||||
{
|
||||
char tab1[120] = "0123456789iiiiijd;s";
|
||||
ft_str_is_numeric(tab1);
|
||||
}*/
|
Reference in New Issue
Block a user