ft_isascii
Subject
ISASCII(3) (simplified)
NAME
isascii -- test for ASCII character
SYNOPSIS
int isascii(int c)
DESCRIPTION
The isascii() function tests for an ASCII character, which is any character between 0 and octal 0177 inclusive.
Understandable explanation
For this function, the man is self-explanatory, even though it doesn't tell you what the return values are...
The isascii()
function returns a non-zero value if the character passed as an int
parameter is an ASCII character between 0 and octal 0177, this means characters between 0 and decimal 127, all characters displayed when you type the man ascii
command.
If the character is not an ASCII character between 0 and octal 0177, the isascii()
function return 0
.
Hints
int ft_isascii(int c)
{
if (/* c is between 0 and decimal 127 */)
return (/* non-zero value of your choice */);
return (0);
}
Commente solution
This works mostly like the 3 other ones we built, there's a little catch though.
Last updated
Was this helpful?