;宏定义切换代码为unicode或者asciii
;code
#ifdef _UNOCODE
#define zymain wmain
#define zyscpy wcscpy
#define zyscat wcscat
#define _T(x) L##x
#define zyprintf wprintf
#define zychar unsigned short int
#else
#define zymain main
#define zyscpy strcpy
#define zyscat strcat
#define _T(x) x
#define zyprintf printf
#define zychar char
#endif
int zymain(){
//正常的unicode编码 用define实现
zychar szHello[]=_T("hello");
zychar szBuf[100];
zyscpy(szBuf,szHello);
zyscat(szBuf,_T(" world"));
#ifdef _DEBUG //是否debug打印调试错误信息
zyprintf(_T("%s\n"),szBuf);
#endif
return 0;
}
时间: 2024-11-04 22:36:49