#include <ctype.h>
|
int
isupper (int c); |
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.
#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
© 2005-2007 Nokia |