#include <wctype.h>
|
|
int
iswalnum (wint_t wch); |
The iswalnum() function tests whether ’wch’ is a wide alphabet or wide digit i.e. it belongs to class alnum(see defns for definition).
The result of this function is undefined unless the argument is WEOF or a valid wchar_t value.
The functionality of this API is independent of the program’s current locale and so it returns non-zero for all the characters (of various locales supported) that belong to the class alnum, irrespective of the locale they belong to.
#include<wctype.h> //iswalnum()
#include<stdio.h> //printf()
void test_iswalnum()
{
int arr[]={’8’,0xe1,’5’,’Z’,0xfd,0xFF12,0xFF19,0xFF71,0x03A3};
int i = 0;
int size = 9;
for( i=0; i<size; i++)
{
int ret = iswalnum(arr[i]); //call to the API with chars in the arr[]
if( (!ret) != 0 )
{
printf("\n%lc is not wide alnum", arr[i]);
}
else
{
printf("\n%lc is a wide alnum ", arr[i]);
}
}
printf("\n");
}
Output
8 is wide alnum
«¡ is wide alnum
5 is wide alnum
Z is wide alnum
«ò is wide alnum
£² is wide alnum
£¹ is wide alnum
± is wide alnum
¦² is wide alnum
|
© 2005-2007 Nokia |