1 wchar_t* c2w(const char *str) 2 { 3 int length = strlen(str)+1; 4 wchar_t *t = (wchar_t*)malloc(sizeof(wchar_t)*length); 5 memset(t,0,length*sizeof(wchar_t)); 6 MultiByteToWideChar(CP_ACP,0,str,strlen(str),t,length); 7 return t; 8 }
时间: 2024-10-31 17:55:17