maxishell
Implementation of a shell for Linux-like systems
Loading...
Searching...
No Matches
ft_is_num.c File Reference
#include "libft.h"
Include dependency graph for ft_is_num.c:

Go to the source code of this file.

Functions

int ft_is_num (const char *n)
 

Function Documentation

◆ ft_is_num()

int ft_is_num ( const char *  n)

Definition at line 15 of file ft_is_num.c.

16{
17 unsigned long i;
18
19 i = 0;
20 while (n[i] && (n[i] == '\t' || n[i] == '\n' || n[i] == '\v'
21 || n[i] == '\f' || n[i] == '\r' || n[i] == ' '))
22 i++;
23 if (n[i] && (n[i] == '+' || n[i] == '-'))
24 i++;
25 if (!n[i])
26 return (FALSE);
27 while (n[i])
28 {
29 if (!ft_isdigit(n[i]))
30 return (FALSE);
31 i++;
32 }
33 return (TRUE);
34}
int ft_isdigit(int c)
Definition ft_isdigit.c:13
#define TRUE
Definition libft.h:104
#define FALSE
Definition libft.h:105

References FALSE, ft_isdigit(), and TRUE.

Here is the call graph for this function: