RonWuYi / cPlus

GNU General Public License v3.0
0 stars 0 forks source link

how to print TCHAR std::wstring on windows c++? #1

Closed RonWuYi closed 4 years ago

RonWuYi commented 4 years ago
LPCTSTR path = _T(".\\test.ini");
TCHAR protocolChar[32];

int a = GetPrivateProfileString(_T("Connection"), _T("Protocol"), _T(""), protocolChar, 32, path);

std::wstring test(&protocolChar[0]); //convert to wstring

std::wcout << test << '\n';