Use iswalnum function to check if a wider character is an alphabet or a digit
Syntax
C iswalnum function has the following format.
int iswalnum(wint_t ch)
Header
C iswalnum function
is from header file wctype.h
.
Description
C iswalnum function returns nonzero if its argument is either a letter of the alphabet or a digit.
It returns zero if the character is not alphanumeric.
Example
Use C iswalnum function to check if a wider character is an alphabet or a digit.
#include <stdio.h>
#include <wctype.h>
/*w w w. j a v a2s .co m*/
int main(void)
{
int wc;
for (wc=0; wc <= 0xFF; wc++) {
printf("%3d", wc);
printf(" %#4x ", wc);
printf("%3s", iswalnum(wc) ? "AN" : " ");
putchar('\n');
}
}
The code above generates the following result.