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 English masses are lovable: they are kind, decent, tolerant, practical and not stupid. The tragedy is that there are too many of them, and that they are aimless, having outgrown the servile functions for which they were encouraged to multiply. One day these huge crowds will have to seize power because there will be nothing else for them to do, and yet they neither demand power nor are ready to make use of it; they will learn only to be bored in a new way.”
—Cyril Connolly (19031974)