tolower() – C函数

C库函数 int tolower(int c)转换给定的字母为小写。

声明

以下是声明的tolower()函数。

int tolower(int c);

参数

  • c -- 这是字母转换为小写。

返回值

这个函数返回小写相当于c,如果存在的值,否则c保持不变。返回值可以隐式char为int值。

例子

下面的例子显示的tolower()函数的用法。

#include<stdio.h>#include<ctype.h>int main(){int i =0;char c;char str[]="YIIBAIS POINT";while( str[i]){
putchar(tolower(str[i]));
i++;}return(0);}

让我们编译和运行上面的程序,这将产生以下结果:

yiibais yiibai

以上是tolower() – C函数的全部内容。
THE END
分享
二维码
< <上一篇
下一篇>>