转换大小写
作者:互联网
toupper函数原型
int toupper(int c)
{
if ((c >= ‘a’) && (c <= ‘z’))
return c + (‘A’ - ‘a’);
return c;
}
再普及一下大写转小写函数:
tolower
tolower函数原型
int tolower(int c)
{
if ((c >= ‘A’) && (c <= ‘Z’))
return c + (‘a’ - ‘A’);
return c;
}
它们有一个优点:只会修改英文字母
注意,这两个函数只能一次修改一个字符
标签:&&,转换,函数,int,大小写,toupper,return,tolower 来源: https://blog.csdn.net/qq_60656035/article/details/121184815