Name

iswupper - tests for uppercase wide character

Library

libc.lib

Synopsis

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

Return values

The functions return zero if the character tests false and return non-zero if the character tests true.

Detailed description

The iswupper() function tests whether wch is a wide-character that belongs to upper-case letters, i.e. checks if it belongs to class upper(see defns for definition).

Characters that belong to class cntrl, punct and digit are not a part of class upper(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 upper, irrespective of the locale they belong to.


Examples

#include<wctype.h> //iswupper()
#include<stdio.h>  //printf()
int test_iswupper()
{
   int arr[]={’8’,0xe1,’5’,’Z’,0x0126 , 0xFF21 ,’G’ , 0x03A4 , 0x00CF };
   int i = 0;
   int size = 9;
   for( i=0; i<size; i++)
   {
     int ret = iswupper(arr[i]); //call to the API with the chars in arr[]
     if( (!ret) != 0 )
     {
        printf("\n%lc is not wide upper-case ", arr[i]);
     }
     else
     {
        printf("\n%lc is wide upper-case", arr[i]);
     }
   }
printf("\n");
}

         

Output

8 is not wide upper-case «¡ is not wide upper-case
5 is not wide upper-case
Z is wide upper-case
©¤ is wide upper-case
£Á is wide upper-case
G is wide upper-case
¦³ is wide upper-case
ªÁ is wide upper-case

         

See also

isupper, iswctype

Feedback

For additional information or queries on this page send feedback

© 2005-2007 Nokia

Top