原型:extern int isupper(int c); 用法:#include 功能:判断字符c是否为大写英文字母 说明:当c为大写英文字母(A-Z)时,返回非零值,否则返回零。 举例: // isupper.c #include #include main() { int c; clrscr(); // clear screen c='a'; printf("%c:%s/n",c,isupper(c)?"yes":"no"); c='A'; printf("%c:%s/n",c,isupper(c)?"yes":"no"); c='7'; printf("%c:%s/n",c,isupper(c)?"yes":"no"); getchar(); return 0; }
--------------------------
Example
/* isupper example */ #include #include int main () { int i=0; char str[]="Test String./n"; char c; while (str[i]) { c=str[i]; if (isupper(c)) c=tolower(c); putchar (c); i++; } return 0; }
Output:
test string.