C++ ';转换';:不是';std&x27;

C++ ';转换';:不是';std&x27;,c++,visual-studio,compiler-errors,C++,Visual Studio,Compiler Errors,这是我的密码 #include "pch.h" #include <iostream> using namespace std; int main() { // su is the string which is converted to lowercase std::wstring su = L"HeLLo WoRld"; // using transform() function and ::toupper in STL std::transf

这是我的密码

#include "pch.h"
#include <iostream>
using namespace std;

int main()
{
    // su is the string which is converted to lowercase
    std::wstring su = L"HeLLo WoRld";

    // using transform() function and ::toupper in STL
    std::transform(su.begin(), su.end(), su.begin(), ::tolower);
    std::cout << su << std::endl;
    return 0;
}
#包括“pch.h”
#包括
使用名称空间std;
int main()
{
//su是转换为小写的字符串
std::wstring su=L“你好,世界”;
//在STL中使用transform()函数和::toupper
std::transform(su.begin(),su.end(),su.begin(),::tolower);
std::cout c:\users\root\source\repos\consoleapplication7\consoleapplication7\consoleapplication7.cpp(14):错误C3861:“转换”:找不到标识符

1> c:\users\root\source\repos\consoleapplication7\consoleapplication7\consoleapplication7.cpp(15):错误C2679:binary'您需要包含标头

加:

#包括

std::transform
在头
中声明,您需要
#包括
对于
std::wstring
使用
std::wcout
此外,为了常量的正确性,尽可能(适当)使用cbegin()和cend(),这帮助我感谢使用命名空间std;或std::transform
1>c:\users\root\source\repos\consoleapplication7\consoleapplication7\consoleapplication7.cpp(14): error C2039: 'transform': is not a member of 'std'
1>c:\users\root\source\repos\consoleapplication7\consoleapplication7\consoleapplication7.cpp(14): error C3861: 'transform': identifier not found
1>c:\users\root\source\repos\consoleapplication7\consoleapplication7\consoleapplication7.cpp(15): error C2679: binary '<<': no operator found which takes a right-hand operand of type 'std::wstring' (or there is no acceptable conversion)
1>    0 Warning(s)
1>    3 Error(s)
#include <algorithm>