isupper()函数

简介: isupper()函数可以用来判断字符c是否为大写英文字母! 原型:extern int isupper(int c); 头文件:ctype.h 功能:判断字符c是否为大写英文字母 说明:当参数c为大写英文字母(A-Z)时,返回非零值,否则返回零。

isupper()函数可以用来判断字符c是否为大写英文字母!

原型:extern int isupper(int c);
头文件: ctype.h
功能:判断 字符c是否为大写英文字母
说明:当参数c为大写英文字母(A-Z)时,返回非零值,否则返回零。
附加说明: 此为 宏定义,非真正函数。
范例:找出字符串str 中为大写英文字母的字符。
  1. #include <ctype.h>
  2. int main()
  3. {
  4. char str[] = "123c@#FDsP[e?";
  5. int i;
  6. for(i = 0; str[i] != 0; i++)
  7. if(isupper(str[i]))
  8. printf("%c is an uppercase character\n", str[i]);
  9. }
执行结果:
F is an uppercase character
D is an uppercase character
P is an uppercase character
目录
相关文章
|
5月前
|
存储 C语言
【我爱C语言】详解字符函数isdigit和字符串转换函数(atoi和snprintf实现互相转换字符串)&&三种strlen模拟实现2
【我爱C语言】详解字符函数isdigit和字符串转换函数(atoi和snprintf实现互相转换字符串)&&三种strlen模拟实现
|
5月前
|
存储 C语言
【我爱C语言】详解字符函数isdigit和字符串转换函数(atoi和snprintf实现互相转换字符串)&&三种strlen模拟实现1
【我爱C语言】详解字符函数isdigit和字符串转换函数(atoi和snprintf实现互相转换字符串)&&三种strlen模拟实现
|
5月前
|
C++
大小写转换——islower/isupper或者tolwer/toupper函数的用法
大小写转换——islower/isupper或者tolwer/toupper函数的用法
44 0
|
5月前
|
C语言
字符函数和字符串函数
字符函数和字符串函数
63 0
|
5月前
|
C语言
深入理解字符串函数和字符函数(islower和isupper、tolower和toupper、strlen、strcpy、strcat、strcmp)(一)
深入理解字符串函数和字符函数(islower和isupper、tolower和toupper、strlen、strcpy、strcat、strcmp)(一)
|
10月前
|
C语言
详解字符函数和字符串函数-2
详解字符函数和字符串函数
44 0
|
12月前
|
Python
python3中,len()、isalpha()、isspace()、isdigit()、isalnum()实例
# 实例:使用while循环 ```python import string s1 = input('请输入一个字符串:\n') letters = 0 space = 0 digit = 0 others = 0 i = 0 while i < len(s1):     c = s1[i]     i += 1     if c.isalpha():         letters += 1     elif c.isspace():         space += 1     elif c.isdigit():         digit += 1   
43 0
|
12月前
|
编译器 C语言 Python
字符函数和字符串函数(上)
字符函数和字符串函数(上)
43 0
字符串函数strncmp
字符串函数strncmp
112 1
字符串函数__strcmp()
字符串一定要有'\0',否则判断不了两字符串是否相等