更新时间:2023-02-18 20:03:29
对于宽字符,您需要使用wcout
而不是cout
.这样做:
You need to use wcout
instead of cout
for wide characters. Do this:
#ifdef UNICODE
typedef wchar_t TCHAR;
#define TEXT(quote) L##quote
#define COUT wcout
#else
typedef char TCHAR;
#define TEXT(quote) quote
#define COUT cout
#endif
然后:
TCHAR* test = TEXT("test");
COUT << test;