-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_isdigit.c
40 lines (37 loc) · 1.33 KB
/
ft_isdigit.c
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
38
39
40
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_isdigit.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mbutt <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/02/25 21:18:48 by mbutt #+# #+# */
/* Updated: 2019/02/25 21:26:12 by mbutt ### ########.fr */
/* */
/* ************************************************************************** */
/*
** The isdigit() function tests for a decimal digit character.
** RETURN VALUES: The isdigit() and isnumber() functions return zero if the
** character tests false and return non-zero if the character tests true.
*/
#include "libft.h"
int ft_isdigit(int c)
{
if (c >= '0' && c <= '9')
{
return (1);
}
else
{
return (0);
}
}
/*
** int main (void)
** {
** char c = '#';
** printf("%d", isdigit(c));
** printf("\n%d", ft_isdigit(c));
** return(0);
** }
*/