Name
iswctype
Synopsis
Ascertains whether a given wide character fits a given description
#include <wctype.h> intiswctype( wint_twc, wctype_tdescription);
The iswctype() function
tests whether the wide character passed as its first argument falls
in the category indicated by the second argument. The value of the
second argument, with the special-purpose type wctype_t, is obtained by calling the
function wctype() with a string
argument that names a property of characters in the current locale.
In the default locale, C,
characters can have the properties listed in Table 17-4.
Table 17-4. Wide character properties
Character property | iswctype() call | Equivalent single function call |
|---|---|---|
“alnum” | iswctype(wc, wctype(“alnum”)) | isalnum(wc) |
“alpha” | iswctype(wc, wctype(“alpha”)) | isalpha(wc) |
“blank” | iswctype(wc, wctype(“blank”)) | isblank(wc) |
“cntrl” | iswctype(wc, wctype(“cntrl”)) | iscntrl(wc) |
“digit” | iswctype(wc, wctype(“digit”)) | isdigit(wc) |
“graph” | iswctype(wc, wctype(“graph”)) | isgraph(wc) |
“lower” | iswctype(wc, wctype(“lower”)) | islower(wc) |
“print” | iswctype(wc, wctype(“print”)) | isprint(wc) |
“punct” | iswctype(wc, wctype(“punct”)) | ispunct(wc) |
“space” | iswctype(wc, wctype(“space”)) | isspace(wc) |
“upper” | iswctype(wc, wctype(“upper”)) | isupper(wc) |
“xdigit” | iswctype(wc, wctype(“xdigit”)) | isxdigit(wc) |
If the wide character argument has the property indicated,
iswctype() returns a nonzero
value (that is, true); if not,
the function returns 0 (false).
Thus the call iswctype(wc, wctype("upper")) is equivalent to
iswupper(wc).
The result of an iswctype() function ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access