How to convert a std::wstring
to a TCHAR*
? std::wstring.c_str()
does not work since it returns a wchar_t*
.
How do I get from wchar_t*
to TCHAR*
, or from std::wstring
to TCHAR*
?
use this :
wstring str1(L"Hello world");
TCHAR * v1 = (wchar_t *)str1.c_str();