C/C++

推荐列表 站点导航

当前位置:首页 > 脚本编程 > C/C++ >

C++_C语言中对字母进行大小写转换的简单方法,C语言tolower()函数:将大写字母

来源:网络整理  作者:  发布时间:2020-12-20 03:12
C语言中对字母进行大小写转换的简单方法,C语言tolower()函数:将大写字母转换为小写字母头文件:#include ctype.h定义函...
C语言tolower()函数:将大写字母转换为小写字母

执行结果:

返回值:返回转换后的小写字母,若不须转换则将参数c 值返回。

before toupper() : aBcDeFgH12345;!#$ after toupper() : ABCDEFGH12345;!#$

范例:将s 字符串内的大写字母转换成小写字母。

函数说明:若参数 c 为大写字母则将该对应的小写字母返回。

头文件:


头文件:

#include <ctype.h> main(){ char s[] = "aBcDeFgH12345;!#$"; int i; printf("before tolower() : %s\n", s); for(i = 0; i < sizeof(s); i++) s[i] = tolower(s[i]); printf("after tolower() : %s\n", s); }

范例:将s 字符串内的小写字母转换成大写字母。

执行结果:

函数说明:若参数 c 为小写字母则将该对应的大写字母返回。

int toupper(int c);

#include <ctype.h> main(){ char s[] = "aBcDeFgH12345;!#$"; int i; printf("before toupper() : %s\n", s); for(i = 0; i < sizeof(s); i++) s[i] = toupper(s[i]); printf("after toupper() : %s\n", s); }

before tolower() : aBcDeFgH12345;!#$ after tolower() : abcdefgh12345;!#$

int tolower(int c);

返回值:返回转换后的大写字母,若不须转换则将参数c 值返回。

定义函数:

定义函数:

C语言tolower()函数:将大写字母转换为小写字母

#include <ctype.h>

#include <stdlib.h>

相关热词: 方法 C++

本站内容来源于网络,如有侵权请与我们联系,我们会及时删除,我们深感抱歉!
注:本站所有信息仅供用于网络技术学习参考,学习中请遵循相关法律法规!

本文地址: https://v30.fanwenzhu.com/jiaob/cjj/5930.shtml

Copyright © www.juheyunku.com      关于 | 合作 | 声明 | 联系 | 更新 | 地图 | Tags

C++_C语言中对字母进行大小写转换的简单方法,C语言tolower()函数:将大写字母

2020-12-20 编辑:

C语言tolower()函数:将大写字母转换为小写字母

执行结果:

返回值:返回转换后的小写字母,若不须转换则将参数c 值返回。

before toupper() : aBcDeFgH12345;!#$ after toupper() : ABCDEFGH12345;!#$

范例:将s 字符串内的大写字母转换成小写字母。

函数说明:若参数 c 为大写字母则将该对应的小写字母返回。

头文件:


头文件:

#include <ctype.h> main(){ char s[] = "aBcDeFgH12345;!#$"; int i; printf("before tolower() : %s\n", s); for(i = 0; i < sizeof(s); i++) s[i] = tolower(s[i]); printf("after tolower() : %s\n", s); }

范例:将s 字符串内的小写字母转换成大写字母。

执行结果:

函数说明:若参数 c 为小写字母则将该对应的大写字母返回。

int toupper(int c);

#include <ctype.h> main(){ char s[] = "aBcDeFgH12345;!#$"; int i; printf("before toupper() : %s\n", s); for(i = 0; i < sizeof(s); i++) s[i] = toupper(s[i]); printf("after toupper() : %s\n", s); }

before tolower() : aBcDeFgH12345;!#$ after tolower() : abcdefgh12345;!#$

int tolower(int c);

返回值:返回转换后的大写字母,若不须转换则将参数c 值返回。

定义函数:

定义函数:

C语言tolower()函数:将大写字母转换为小写字母

#include <ctype.h>

#include <stdlib.h>

本站内容来源于网络,如有侵权请与我们联系,我们会及时删除,我们深感抱歉!
注:本站所有信息仅供学习参考!
本文地址为 https://v30.fanwenzhu.com/jiaob/cjj/5930.shtml