BKS*_*BKS -4 c++ compiler-errors visual-studio
Here is my code
#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;
}
Run Code Online (Sandbox Code Playgroud)
It generates the following compilation error.
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)
Run Code Online (Sandbox Code Playgroud)
What am I doing wrong here?
| 归档时间: |
|
| 查看次数: |
281 次 |
| 最近记录: |