我想知道如何将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