ctype: isalnum(), isalpha(), isascii(), isblank(), iscntrl(),
isdigit(), isgraph(), islower(), isprint(), ispunct(), isspace(), isup‐
per(), isxdigit() - classify characters according to type
These functions classify character-coded integer values according to
the rules of the coded character set identified by the last successful
call to (see setlocale(3C)). Each function is a predicate returning
nonzero for true, zero for false.
If has not been called successfully, characters are classified accord‐
ing to the rules of the default ASCII 7-bit coded character set (see
is defined on all integer values; the other functions are defined for
the range (EOF) through
The functions return nonzero under the following circumstances; zero
c is an alphanumeric (letters or digits).
c is a letter.
c is any ASCII character code between 0 and
c is a blank character; that is, a space or a
c is a control character (in ASCII: character
codes less than 040 and the delete character
c is a decimal digit (in ASCII: characters
c is a visible character (in ASCII: printing
characters, excluding the space character
c is a lowercase letter.
c is a printing character.
c is a punctuation character (in ASCII: any
printing character except the space charac‐
ter (040), digits, letters).
c is a character that creates whitespace in
displayed text (in ASCII: space, tab, car‐
riage return, newline, vertical tab, and
c is an uppercase letter.
c is a hexadecimal digit (in ASCII: characters
[0-9], [A-F] or [a-f]).
If the argument to any of these functions is outside the domain of the
function, the result is undefined.
The category determines the classification of character type.
International Code Set Support
Single-byte character code sets are supported.
These functions are supplied both as library functions and as macros
defined in the header. Normally, the macro versions are used. To
obtain the library function, either use a to remove the macro defini‐
tion or, if compiling in ANSI-C mode, enclose the function name in
parenthesis or take its address. The following example uses the
library functions for and
was developed by IBM, OSF, and HP.
SEE ALSOsetlocale(3C), ascii(5), thread_safety(5).