Bas*_*asj 10 c++ string winapi concatenation string-concatenation
在Visual C++中,我有一个
LPWSTR mystring;
Run Code Online (Sandbox Code Playgroud)
已在代码中的其他位置定义.
我想创建一个新的LPWSTR,其中包含:
"hello " + mystring + " blablabla" (i.e. a concatenation)
Run Code Online (Sandbox Code Playgroud)
我生气这么简单(连接)!非常感谢,我迷路了!
小智 18
C++方式:
std::wstring mywstring(mystring);
std::wstring concatted_stdstr = L"hello " + mywstring + L" blah";
LPCWSTR concatted = concatted_stdstr.c_str();
Run Code Online (Sandbox Code Playgroud)
您可以使用StringCchCatW函数