Use C iswdigit function to check if a wide character is a digit
Syntax
C iswdigit function has the following syntax.
int iswdigit(wint_t ch)
Header
C iswdigit function
is from header file wctype.h
.
Description
C iswdigit function returns nonzero if ch
is a digit or zero is returned.
Example
Use C iswdigit function to tell if a wide character is a digit.
#include <stdio.h>
#include <wctype.h>
//from www. j a va2 s. c om
int main(void)
{
int wc;
for (wc=0; wc <= 0xFF; wc++) {
printf("%3d", wc);
printf(" %#4x ", wc);
printf("%2s", iswdigit(wc) ? "D" : " ");
putchar('\n');
}
}
The code above generates the following result.