C 库函数 - tolower()

C 语言教程 · 2019-02-22 22:12:29

描述

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

声明

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

int tolower(int c);

参数

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

返回值

如果 c 有相对应的小写字母,则该函数返回 c 的小写字母,否则 c 保持不变。返回值是一个可被隐式转换为 char 类型的 int 值。

实例

下面的实例演示了 tolower() 函数的用法。

实例

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

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

codercto

点击查看所有 C 语言教程 文章: https://codercto.com/courses/l/17.html

查看所有标签

图形程序开发人员指南

图形程序开发人员指南

Michael Abrash / 前导工作室 / 机械工业出版社 / 1998 / 128

Michael Abrash's classic Graphics Programming Black Book is a compilation of Michael's previous writings on assembly language and graphics programming (including from his "Graphics Programming" column......一起来看看 《图形程序开发人员指南》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

html转js在线工具
html转js在线工具

html转js在线工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具