CTYPE(3) — UNIX Programmer’s Manual
NAME
isalnum, isalpha, isascii, iscntrl, isdigit, islower, isprint, ispunct, isspace, isupper, toascii, tolower, toupper − character classification and conversion macros
SYNOPSIS
#include <ctype.h>
isalnum(c)
. . .
DESCRIPTION
The is∗ macros classify ASCII-coded integer values by table lookup. Each is a predicate returning nonzero for true, zero for false. Isascii is defined on all integer values; the rest are defined only where isascii is true and on the single non-ASCII value EOF (see stdio(3S)). If toupper is provided with a lower case letter (can be ensured by using isascii and islower both true) it will return an upper case ASCII character. Input other than lower case results in undefined values. If tolower is provided with an upper case letter (can be ensured by using isascii and isupper both true) it will return a lower-case ASCII character. Input other than upper case results in undefined values. No matter what value c has, toascii returns an ASCII character.
These following macros return non-zero when c meets the indicated criteria:
isalnum c is an alphanumeric character
isalpha c is a letter
isascii c is an ASCII character, code less than 0200.
iscntrl c is a delete character (0177) or ordinary control character (less than 040).
isdigit c is a digit
islower c is a lower case letter
isprint c is a printing character, code 040(8) (space) through 0176 (tilde)
ispunct c is a punctuation character (neither control nor alphanumeric)
isspace c is a space, tab, carriage return, newline, or formfeed
isupper c is an upper case letter
SEE ALSO
7th Edition