char 字符大小写转换
#include <iostream>
using namespace std;
int main()
{
char c = 'e';
c = toupper(c);//并不会直接覆盖
cout << c;
system("pause");
return 0;
}
string 字符串大小写转换
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main()
{
string str="how are you";
transform(str.begin(),str.end(),str.begin(),::toupper);//第三个参数指定存放转换后的结果,这里覆盖原string
cout << str << endl;
return 0;
}