Name

isupper - character classification routines

Library

libc.lib

Synopsis

  #include <ctype.h>
  int isupper (int c);

Return values

The isupper function returns non-zero if ’c’ is in upper case and zero otherwise.

Detailed description

The isupper function tests if ’c’ is an upper-case alphabet i.e. it belongs to class upper(see defns for definition). For single character representations, the value of the argument is representable as an unsigned char or the value of EOF.

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<ctype.h> //isupper()
#include<stdio.h> //printf()
int test_isupper()
{
int arr[]={0x0126,’G’,’7’,’B’,0x3041};
int i = 0;
int size = 5;
for( i=0; i<size; i++)
{
   int ret = isupper(arr[i]); //call to the API with chars in arr[]
   if( (!ret) != 0 )
   {
        printf("\n%c is not in upper-case ", arr[i]);
   }
   else
   {
        printf("\n%c is in upper-case", arr[i]);
   }
   }
printf("\n");
}

         

Output

& is in upper-case
G is in upper-case
7 is not in upper-case
B is in upper-case
A is in upper-case

         

See also

iswupper, toupper

Feedback

For additional information or queries on this page send feedback

© 2005-2007 Nokia

Top