#include "stdafx.h"
#include "windows.h"
int _tmain(int argc, _TCHAR* argv[])
{
char buffer[100];
const wchar_t pUnicode[100] =L"长和";
for (int i=0;i
printf("16进制:%x\n",pUnicode[i]);
//方法一
WideCharToMultiByte(CP_ACP, 0, pUnicode, -1, buffer, 100, NULL,NULL);
printf("buffer:%s\n",buffer);
//方法二
wcstombs (buffer, pUnicode,100);
printf("buffer:%s\n",buffer);
for (int i=0;i
printf("16进制:%x\n",(unsigned char)buffer[i]);
system("pause");
}