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:

    Nobody is so constituted as to be able to live everywhere and anywhere; and he who has great duties to perform, which lay claim to all his strength, has, in this respect, a very limited choice. The influence of climate upon the bodily functions ... extends so far, that a blunder in the choice of locality and climate is able not only to alienate a man from his actual duty, but also to withhold it from him altogether, so that he never even comes face to face with it.
    Friedrich Nietzsche (1844–1900)