Format
#include <wctype.h>
int iswalnum(wint_t wc);
int iswalpha(wint_t wc);
int iswcntrl(wint_t wc);
int iswdigit(wint_t wc);
int iswgraph(wint_t wc);
int iswlower(wint_t wc);
int iswprint(wint_t wc);
int iswpunct(wint_t wc);
int iswspace(wint_t wc);
int iswupper(wint_t wc);
int iswxdigit(wint_t wc);
Language Level: ANSI
Threadsafe: Yes.
Locale Sensitive: The behavior of these functions might be affected by the LC_CTYPE category of the current locale if LOCALETYPE(*LOCALE) is specified on the compilation command. The behavior of these functions might be affected by the LC_UNI_CTYPE category of the current locale if either the LOCALETYPE(*LOCALEUCS2) option or the LOCALETYPE(*LOCALEUTF) option is specified on the compilation command. These functions are not available when LOCALETYPE(*CLD) is specified on the compilation command. For more information, see Understanding CCSIDs and Locales.
Wide Character Function: See Wide Characters for more information.
Description
The functions listed above, which are all declared in <wctype.h>, test a given wide integer value.
The value of wc must be a wide-character code corresponding to a valid character in the current locale, or must equal the value of the macro WEOF. If the argument has any other value, the behavior is undefined.
Here are descriptions of each function in this group.
Returned Value
These functions return a nonzero value if the wide integer satisfies the test value, or a 0 value if it does not. The value for wc must be representable as a wide unsigned char. WEOF is a valid input value.
Example
#include <stdio.h>
#include <wctype.h>
int main(void)
{
int wc;
for (wc=0; wc <= 0xFF; wc++) {
printf("%3d", wc);
printf(" %#4x ", wc);
printf("%3s", iswalnum(wc) ? "AN" : " ");
printf("%2s", iswalpha(wc) ? "A" : " ");
printf("%2s", iswcntrl(wc) ? "C" : " ");
printf("%2s", iswdigit(wc) ? "D" : " ");
printf("%2s", iswgraph(wc) ? "G" : " ");
printf("%2s", iswlower(wc) ? "L" : " ");
printf(" %c", iswprint(wc) ? wc : ' ');
printf("%3s", iswpunct(wc) ? "PU" : " ");
printf("%2s", iswspace(wc) ? "S" : " ");
printf("%3s", iswprint(wc) ? "PR" : " ");
printf("%2s", iswupper(wc) ? "U" : " ");
printf("%2s", iswxdigit(wc) ? "X" : " ");
putchar('\n');
}
}
Related Information