具体代码:
static char* add_arg_to_array(const wchar_t* arg) { int iSize = WideCharToMultiByte(CP_ACP, 0, arg, -1, NULL, 0, NULL, NULL); char* chdata = (char*)malloc(iSize*sizeof(char)); WideCharToMultiByte(CP_ACP, 0, arg, -1, chdata, iSize, NULL, NULL); return chdata; }