iswalpha - test for alphabetic wide character


Library

libc.lib

Synopsis

  #include <wctype.h>
  int iswalpha (wint_t wch);

Return values

The functions return non-zero if ’wch’ is a wide alphabet and zero otherwise.

Detailed description

The iswalpha() function tests whether ’wch’ is a wide alphabet i.e. it belongs to class alpha(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 alpha, irrespective of the locale they belong to.


Examples

#include<wctype.h> //iswalpha()
#include<stdio.h>  //printf()
void test_iswalpha()
{
   int arr[]={’a’,0xe1,’5’,’Z’,0xfd, 0x3041,0xFF9D,0x009F,0x007E};
   int i = 0;
   int size = 9;
   for( i=0; i<size; i++)
   {
     int ret = iswalpha(arr[i]); //call to API with chars in arr[]
     if( (!ret) != 0 )
     {
        printf("\n%lc is not wide alphabet", arr[i]);
     }
     else
     {
        printf("\n%lc is wide alphabet", arr[i]);
     }
   }
printf("\n");
}

         

Output

a is wide alphabet
«¡ is wide alphabet
5 is not wide alphabet
Z is wide alphabet
«ò is wide alphabet
¤¡ is wide alphabet
Ý is wide alphabet
 is not wide alphabet
~ is not wide alphabet

         

See also

isalpha, iswctype

Feedback

For additional information or queries on this page send feedback

© 2005-2007 Nokia

Top