Next: Stdio, Previous: Stdlib, Up: Top

## 3 Character Type Macros and Functions (`ctype.h`)

This chapter groups macros (which are also available as subroutines) to classify characters into several categories (alphabetic, numeric, control characters, whitespace, and so on), or to perform simple character mappings.

The header file `ctype.h` defines the macros.

- isalnum: Alphanumeric character predicate
- isalpha: Alphabetic character predicate
- isascii: ASCII character predicate
- iscntrl: Control character predicate
- isdigit: Decimal digit predicate
- islower: Lowercase character predicate
- isprint: Printable character predicates (isprint, isgraph)
- ispunct: Punctuation character predicate
- isspace: Whitespace character predicate
- isupper: Uppercase character predicate
- isxdigit: Hexadecimal digit predicate
- toascii: Force integers to ASCII range
- tolower: Translate characters to lowercase
- toupper: Translate characters to uppercase
- iswalnum: Alphanumeric wide character predicate
- iswalpha: Alphabetic wide character predicate
- iswblank: Blank wide character predicate
- iswcntrl: Control wide character predicate
- iswdigit: Decimal digit wide character predicate
- iswgraph: Graphic wide character predicate
- iswlower: Lowercase wide character predicate
- iswprint: Printable wide character predicate
- iswpunct: Punctuation wide character predicate
- iswspace: Whitespace wide character predicate
- iswupper: Uppercase wide character predicate
- iswxdigit: Hexadecimal digit wide character predicate
- iswctype: Extensible wide-character test
- wctype: Compute wide-character test type
- towlower: Translate wide characters to lowercase
- towupper: Translate wide characters to uppercase
- towctrans: Extensible wide-character translation
- wctrans: Compute wide-character translation type