0

我想知道如何转换string str = "whatever"为,wchar_t以便字符串可以存储为wchar_t chResponse[] = ...(converted from string)..

我正在尝试以下代码:

string str = "whatever";
std::wstring_convert<std::codecvt_utf8<wchar_t>> utf8conv;
auto w_result = utf8conv.from_bytes(str); // convert utf8 to wchar_t
wchar_t chResponse[] = w_result;

它给了我这个错误:

error C2075: 'chResponse' : array initialization needs curly braces
4

0 回答 0