C语言常用函数-tolower()将字符转换为小写英文字母函数


演示版本

VS2013

  • tolower()函数

tolower()函数用于把大写字母转换为小写字母,不是大写字母的不变。

语法

int tolower(int ch);

tolower()函数的语法参数说明如下:

参数ch为待转换的字符。

tolower()函数的返回值:转换后的字符。

示例

本示例演示用tolower()函数把大写字母转换为小写字母。其具体代码如下:

#include <stdio.h>
#include <ctype.h>

int main()
{
    char ch1, ch2;
    printf("input a character\n");
    scanf_s("%c", &ch1);
    ch2 = tolower(ch1);
    printf("transform %c to %c\n", ch1, ch2);

    return 0;
}

 

阿飞

2021年7月28日


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM