Home

iswctype

iswctype is a function in the C standard library used to test whether a given wide character belongs to a specified character class. It is declared in the header <wctype.h> and works with wide characters represented as wint_t. The function takes two arguments: the wide character wc and a mask of type wctype_t that describes one or more character classes. It returns a nonzero value if wc has any of the properties indicated by the mask, and zero otherwise.

The mask is obtained or constructed through the wctype function, which maps a character class name to

iswctype is locale-sensitive; the classification of a character depends on the current locale settings. Therefore the

Common usage involves testing a wide character against a known class, for example testing whether a character

See also iswalpha, iswalnum, wctype, and setlocale for related means of character classification and locale control.

a
corresponding
wctype_t
value.
Typical
class
names
include
"alpha",
"digit",
"space",
"upper",
and
"lower".
A
mask
may
represent
a
single
class
or,
in
some
implementations,
a
combination
of
classes
using
bitwise
operations
on
wctype_t
values.
The
exact
interpretation
of
a
combined
mask
is
implementation
dependent,
so
users
should
consult
their
compiler’s
documentation
for
portable
usage.
same
wide
character
may
yield
different
results
in
different
locales.
is
a
decimal
digit
or
an
alphabetic
letter.
A
positive
result
indicates
that
wc
satisfies
at
least
one
of
the
classes
encoded
in
mask.