19,468
社区成员
发帖
与我相关
我的任务
分享
wchar_t *w_str;
w_str = new wchar_t[4];
if(!w_str)
delete []w_str;
unsigned char word[3]={0};//word中的汉字是"天"
char arr[3]={0};
//将unsigned char*转换为char*
memcpy(&arr[0], &word[0], 3);
//char[]转换为wchar_t *
MultiByteToWideChar (CP_ACP, 0, arr, -1, w_str, 3);