-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_str_is_numeric.c
More file actions
37 lines (33 loc) · 1.35 KB
/
ft_str_is_numeric.c
File metadata and controls
37 lines (33 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_str_is_numeric.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: bnoufel <bnoufel@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/02/08 16:04:55 by bnoufel #+# #+# */
/* Updated: 2020/02/08 19:49:38 by bnoufel ### ########.fr */
/* */
/* ************************************************************************** */
#include "char.h"
/*
** @param str
** The ft_str_is_numeric() function tests for any character for ft_isdigit is
** true.
************************* RETURN VALUES **********************************
** The ft_str_is_numeric() function returns zero if one of character tests
** false and returns non-zero if one of character tests true.
*/
int ft_str_is_numeric(const char *str)
{
size_t i;
i = 0;
while (str[i])
{
if (ft_isdigit(str[i]))
i++;
else
return (0);
}
return (1);
}