ft_isdigit
Subject
ISDIGIT(3) (simplified)
NAME
isdigit -- decimal-digit character test
SYNOPSIS
int isdigit(int c)
DESCRIPTION
The isdigit() function tests for a decimal digit character.
The value of the argument must be representable as an unsigned char or the value of EOF.
RETURN VALUES
The isdigit() function return zero if the character tests false and return non-zero if the character tests true.
Understandable explanation
For this function, the man is self-explanatory, but I'll still explain it in other words.
The isdigit()
function return a non-zero value if the character passed as an int
parameter is a decimal digit character (0 - 9).
If the character is not a decimal digit character, the isdigit()
function return 0
.
Hints
int ft_isdigit(int c)
{
if (/* c value is one of the decimal digit characters in the ASCII table */)
return (/* non-zero value of your choice */);
return (0);
}
Commented solution
Come on ! You really need the code for that function ?
Last updated
Was this helpful?