-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_isint.c
29 lines (26 loc) · 1.07 KB
/
ft_isint.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_isint.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ciglesia <ciglesia@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/08/25 13:35:14 by ciglesia #+# #+# */
/* Updated: 2020/08/25 17:52:31 by ciglesia ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
int ft_isint(char *str)
{
int i;
i = 0;
if (str[i] && str[i] == '-')
i++;
while (str[i])
{
if (!ft_isdigit(str[i]))
return (0);
i++;
}
return (!exceeds_int(str));
}