#include <Windows.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <locale.h> int main() { setlocale(LC_ALL, ""); WCHAR szWchar[MAX_PATH] = L"WCHAR中文TEST"; char szChar[MAX_PATH] = "CHAR汉语测试TEST"; printf("szWchar = %S, length = %d\n", szWchar, wcslen(szWchar)); printf("szChar = %s, length = %d\n", szChar, strlen(szChar)); wprintf(L"wprintf szWchar = %s\n", szWchar); wprintf(L"wprintf szChar = %S\n", szChar); printf("end\n"); system("pause"); return 0; }