const char *sztext="kfjdsalkfjalskd"; char *buf = new char[strlen(sztext)+1]; //const char* 到char *的转换 strcpy(buf, sztext); int size = MultiByteToWideChar(CP_ACP,0,buf,-1,NULL,0); //char * 到whar_t *的转换 wchar_t *wchar = new wchar_t[size+1]; MultiByteToWideChar(CP_ACP,0,buf,-1,wchar,size);
分了二部,更简练而已。