使用以下两个c++ STL函数
_Check_return_ _ACRTIMP wint_t __cdecl towupper(_In_ wint_t _C);
_Check_return_ _ACRTIMP wint_t __cdecl towlower(_In_ wint_t _C);
完整代码如下:
wstring input;
cout << "Input Y(Yes),Install Driver!" << endl;
cout << "Start S(Start),Start Driver!" << endl;
wcin >> input;
for(auto &str : input)//转换小写
{
str = ::towlower(str);
}
for (auto &str : input)//转换大写
{
str = ::towupper(str);
}