Ram*_*lol 7 c++ string winapi visual-c++
我有两个变量是LPCWSTRs.我想创建一个具有第一个和第二个变量值的新变量.
我尝试了这个,但它没有用.
LPCWSTR d = L"sd";
LPCWSTR f = L"f";
LPCWSTR df = d + f;
Run Code Online (Sandbox Code Playgroud)
当我尝试时,我收到此错误.
1 IntelliSense: expression must have integral or enum type
Run Code Online (Sandbox Code Playgroud)
有没有可以结合两个LPCWSTRs 的功能?
Kir*_*sky 12
在C++中,使用std::string字符串进行操作通常是个好主意.在你的情况下它可能看起来像:
LPCWSTR d = L"sd";
LPCWSTR f = L"f";
std::wstring df = std::wstring(d) + f;
LPCWSTR dfc = df.c_str(); // if you are really need this
Run Code Online (Sandbox Code Playgroud)