在C++中,可以使用std::wstring来表示wchar_t类型的字符串,然后使用+运算符来进行字符串拼接。例如:
#include <iostream>#include <string>int main() { std::wstring str1 = L"Hello, "; std::wstring str2 = L"world!"; std::wstring result = str1 + str2; std::wcout << result << std::endl; return 0;}在上面的例子中,我们使用std::wstring表示wchar_t类型的字符串,然后使用+运算符将两个字符串拼接在一起,最终输出结果为Hello, world!。


