原型:extern int isupper(int c);
头文件:ctype.h
功能:判断字符c是否为大写英文字母
说明:当参数c为大写英文字母(A-Z)时,返回非零值,否则返回零。
附加说明: 此为宏定义,非真正函数。
举例1:(在Visual C++6.0中运行通过)
#include <ctype.h>
#include <stdio.h>
int main()
{
char Test[]="a1B2c3D4";
char *pos;
pos=Test;
while(*pos!=0)
{
if(isupper(*pos))
printf("%c",*pos);
pos++;
}
printf("\n");
return 0;
}
输出:BD
温馨提示:答案为网友推荐,仅供参考