C语言 islower()函数

islower()函数

C语言中,ctype.h库中的islower()函数用于判断字符是否是一个小写的字母。islower()函数的语法如下:

int islower(int c);

islower()参数

参数描述
c字符,int类型,比如'c',字符的ASCII编码是数字

islower()返回值

如果参数字符是小写字母,则返回非零值,否则返回0。

islower()实例代码

如下实例代码,用islower()函数判断字符'A'和'b':

#include "stdio.h"
#include "ctype.h"


int main() {
    int m = 'A';
    int n = 'b';
    int t1 = islower(m);
    int t2 = islower(n);
    printf("%d\n",t1);
    printf("%d\n",t2);

    return 0;

}

免责声明:内容仅供参考,不保证正确性。


全栈后端 / C语言教程 :


















Copyright © 2022-2024 笨鸟工具 x1y1z1.com All Rights Reserved.