淡泊明志 宁静致远
分类: C/C++
2006-12-08 22:36:42
【C语言库函数源代码】
【本程序在Dev C++ 4.9.9.2 下编译通过】
int my_isupper( int ch )
{
return (unsigned int)(ch -
'A') < 26u;
}//判断字符c是否为大写英文字母
int main()
{
char ch =
'c';
if(my_isupper(ch))
printf("%c is Upper English
Character!\n",ch);
else
printf("%c is not a Upper English
Character!\n",ch);
ch = 'A';
if(my_isupper(ch))
printf("%c is Upper English
Character!\n",ch);
else
printf("%c is not a Upper English
Character!\n",ch);
system("pause");
return 0;
}