目录

int tolower(int c)

描述 (Description)

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

声明 (Declaration)

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

int tolower(int c);

参数 (Parameters)

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

返回值 (Return Value)

此函数返回等于c的小写,如果存在此值,则c保持不变。 该值作为int值返回,可以隐式转换为char

例子 (Example)

以下示例显示了tolower()函数的用法。

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

让我们编译并运行上述程序以产生以下结果 -

tutorials point
↑回到顶部↑
WIKI教程 @2018