I want to know how I can convert string str = "whatever"
to wchar_t
so that the string can be stored as wchar_t chResponse[] = ...(converted from string)..
I am trying the following code:
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;
Its giving me this error:
error C2075: 'chResponse' : array initialization needs curly braces