1.输出中文
xx.h
- #ifdef NOTANSI
- typedef std::wstring token_t;
- #define TOKEN L
- #define CONST_TEXT(x) L##x
- #define gcout std::wcout
- #else
- typedef std::string token_t;
- #define TOKEN
- #define CONST_TEXT(x) x
- #define gcout std::cout
- #endif
xx.cpp
- #ifdef NOTANSI
- std::locale gloc("Chinese-simplified");
- struct xcout{
- xcout(){gcout.imbue(gloc);}
- }aXCOUT;
- #endif
stdafx.h
- #define NOTANSI