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:
“Adolescents, for all their self-involvement, are emerging from the self-centeredness of childhood. Their perception of other people has more depth. They are better equipped at appreciating others reasons for action, or the basis of others emotions. But this maturity functions in a piecemeal fashion. They show more understanding of their friends, but not of their teachers.”
—Terri Apter (20th century)