I need to put WCHAR[] to std::cout ... It is a part of PWLAN_CONNECTION_NOTIFICATION_DATA passed from Native Wifi API callback.
I tried simply std::cout << var; but it prints out the numeric address of first char. the comparision (var == L"some text"
) doesn't work either. The debugger returns the expected value, however the comparision returns 0. How can I convert this array to a standard string(std::string)?
Thanks in advance
"some text"=="some text"
can already fail, with plainchar*
. Reason: you can compare strings in C with==
. Use C++;std::wstring(L"text")==std::wstring(L"text")
– Jochebed