islower() 函数原型
int islower( int arg );
islower() 函数接受一个整数作为参数,并返回一个 int
类型的值。
尽管 islower() 接受整数作为参数,但实际传递给函数的是字符。在内部,字符会转换为其 ASCII 值进行检查。
它定义在 <ctype.h> 头文件中。
C islower() 返回值
返回值 | 备注 |
---|---|
非零值 (x > 0) | 参数是小写字母。 |
零 (0) | 参数不是小写字母。 |
示例:C islower() 函数
#include <stdio.h>
#include <ctype.h>
int main()
{
char c;
c='t';
printf("Return value when %c is passed to islower(): %d", c, islower(c));
c='D';
printf("\nReturn value when %c is passed to islower(): %d", c, islower(c));
return 0;
}
输出
Return value when t is passed to islower(): 2 Return value when D is passed to is islower(): 0
注意: 当您在系统上将小写字母传递给 islower() 时,可能会得到不同的整数值。但是,当您将小写字母以外的任何字符传递给 islower() 时,它总是返回 0。