LPWSTR字符串的连接 [英] Concatenation of LPWSTR strings
本文介绍了LPWSTR字符串的连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在Visual C ++中,我有一个
In Visual C++, I have a
LPWSTR mystring;
已在代码中的其他位置定义。
which is already defined somewhere else in the code.
我想创建一个新的LPWSTR包含:
I want to create a new LPWSTR containing:
"hello " + mystring + " blablabla" (i.e. a concatenation)
我越来越疯狂这样一个简单的事情非常感谢,我很失望!
I'm getting mad with such a simple thing (concatenation)! Thanks a lot in advance, I'm lost!
推荐答案
C ++方式:
std::wstring mywstring(mystring);
std::wstring concatted_stdstr = L"hello " + mywstring + L" blah";
LPWSTR concatted = concatted_stdstr.c_str();
这篇关于LPWSTR字符串的连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文