1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > c语言怎样识别字母大小写 c语言islower()函数如何判断字符是否为小写字母

c语言怎样识别字母大小写 c语言islower()函数如何判断字符是否为小写字母

时间:2019-02-10 09:38:06

相关推荐

c语言怎样识别字母大小写 c语言islower()函数如何判断字符是否为小写字母

c语言islower()函数如何判断字符是否为小写字母?引入的头文件:#include

定义islower()函数方法:int islower(int c);

islower()函数介绍:检查参数 c 是否为小写英文字母。

islower()函数返回值:若参数c 为小写英文字母,则返回true,否则返回null(0)。

附加说明:此为宏定义,非真正函数。

islower()函数实例:判断str 字符串中哪些为小写字母。

#include

main(){

char str[] = "123@#FDsP[e?";

int i;

for(i = 0; str[i] != 0; i++)

if(islower(str[i]))

printf("%c is a lower-case character\n", str[i]);

}

程序实例执行结果:

c is a lower-case character

s is a lower-case character

e is a lower-case character

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。