C++实现大写字母向小写字母的转化

来源:互联网 发布:美即黑茶酵力面膜知乎 编辑:程序博客网 时间:2024/05/20 06:39

#include<cctype>

#include<iostream.h>


string str("STEVEN");


for (string::size_type st = 0; st != str.size(); st++)

{

str[st] = tolower(str[st]);                           //把大写转化为小写

cout << str[st] ;

}


原创粉丝点击