forked from bridiefranks/42-libft-with-comments
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_isdigit.c
34 lines (31 loc) · 1.27 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_isdigit.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: bfranks <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/02/24 14:35:57 by bfranks #+# #+# */
/* Updated: 2022/03/22 12:27:10 by bfranks ### ########.fr */
/* */
/* ************************************************************************** */
/*Similar to isalpha, this function tells you whether the int c you input is a digit character (return 1)
* or not (return (0).
*Could also be written as: if ((c >= 48) && (c <= 57)).*/
#include "libft.h"
/*#include <stdio.h>*/
int ft_isdigit(int c)
{
if ((c >= '0') && (c <= '9'))
{
return (1);
}
return (0);
}
/*int main(void)
{
int v;
v = ft_isdigit('f');
printf("%d\n", v);
return (0);
}*/