I’m quite sure that it is a stupid issue but it drives me crazy..
how could i print on the console a TCHAR array?
DWORD error = WSAGetLastError();
TCHAR errmsg[512];
int ret = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, 0, error, 0, errmsg, 511, NULL);
i need to print errmsg…
It depends on what
TCHARis. If you compile with Unicode enabled,TCHARis defined aswchar_t. Then you can usestd::wcout, for example:If Unicode is not enabled,
TCHARis an ordinarycharand you can use the ordinarystd::cout: