#include <ctype.h>
|
|
int
toupper (int c); |
#include<ctype.h> //toupper()
#include<stdio.h> //printf()
int test_toupper()
{
struct st
{
int input;
int output;
};
struct st arr[]=
{
{ ’q’, ’Q’ },
{ ’G’ , ’G’ },
{ ’9’ , ’9’ },
{ ’%’ , ’%’ },
{ ’\t’ , ’\t’ },
};
int i = 0;
int size = 5;
for( i=0; i<size; i++)
{
int ret = toupper(arr[i].input);//call to the API with the chars in arr[]
if( ret != arr[i].output )
{
printf("\n%c cannot convert ", arr[i].input);
}
else
{
printf("\n%c ", arr[i].output);
}
}
printf("\n");
}
Output
q
G
9
%
|
© 2007-2009 Nokia Corporation. All rights reserved. This documentation can be used in the connection with this Product to help and support the user. |
|