C Character Classification - Overview of Functions

Overview of Functions

The functions that operate on single-byte characters are defined in ctype.h header (cctype header in C++). The functions that operate on wide characters are defined in wctype.h header (cwctype header in C++).

The classification is done according to the current locale.

Byte
character
Wide
character
Description
isalnum iswalnum checks if a byte/wchar_t is alphanumeric
isalpha iswalpha checks if a byte/wchar_t is alphabetic
islower iswlower checks if a byte/wchar_t is lowercase
isupper iswupper checks if a byte/wchar_t is an uppercase byte/wchar_t
isdigit iswdigit checks if a byte/wchar_t is a digit
isxdigit iswxdigit checks if a byte/wchar_t is a hexadecimal byte/wchar_t
iscntrl iswcntrl checks if a byte/wchar_t is a control byte/wchar_t
isgraph iswgraph checks if a byte/wchar_t is a graphical byte/wchar_t
isspace iswspace checks if a byte/wchar_t is a space byte/wchar_t
isblank iswblank checks if a byte/wchar_t is a blank byte/wchar_t (C99/C++11)
isprint iswprint checks if a byte/wchar_t is a printing byte/wchar_t
ispunct iswpunct checks if a byte/wchar_t is a punctuation byte/wchar_t
tolower towlower converts a byte/wchar_t to lowercase
toupper towupper converts a byte/wchar_t to uppercase
iswctype checks if a wchar_t falls into specific class
towctrans converts a wchar_t using a specific mapping
wctype returns a wide character class to be used with iswctype
wctrans returns a transformation mapping to be used with towctrans

Read more about this topic:  C Character Classification

Famous quotes containing the word functions:

    The mind is a finer body, and resumes its functions of feeding, digesting, absorbing, excluding, and generating, in a new and ethereal element. Here, in the brain, is all the process of alimentation repeated, in the acquiring, comparing, digesting, and assimilating of experience. Here again is the mystery of generation repeated.
    Ralph Waldo Emerson (1803–1882)