I have the following code:
Code:
/* The program convert lower case to upper case
or upper case to lower case, according to the
name display in arg[0]*/
---------------------------------------------------------------------------------------------------------------
#include<stdio.h>
#include<stdlib.h>
#include<ctype.h>
int main(int argc, char **argv)
{
int(*convcase[2])(int)={toupper,tolower};
int func;
int result = EXIT_SUCCESS;
int ch;
if(argc > 0)
{
if(toupper((unsigned char)argv[0][0])=='U')
func=0;
else
func=1;
while ((ch=getchar()!=EOF))
{
ch(*convcase[func])((unsigned char)ch);
putchar(ch);
}
}
else
{
fprintf(stderr,"Unknown name.\n");
result=EXIT_FAILURE;
}
return (result);
}
---------------------------------------------------------------------------------------------------------------
Can someone advise what is the meaning of the following line, I do not understand it:
if(toupper((unsigned char)argv[0][0])=='U')
Thanks,
itit