// Ton tableau de paramètres std::vector<std::string> tabParam; // Le tableau que l'on va passer à execv const char** tabParamExecv=new char* [(tabParam.size() + 1) * sizeof(const char*)]; // Recopie des valeurs int i=0; for(std::vector<std::string>::iterator it=tabParam.begin();it!=tabParam.end();it++) tabParamExecv[i++]=(*it).c_str(); // Ajout du NULL qui détermine la fin du tableau tabParamExecv[i]=NULL; // Appel de execv execv(STR_CMDNAME, tabParamExecv);
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question