I'm having an issue with my code.
What I'm trying to do is get the executable path dynamically, then assign it to char* n_argv
array. I've really been trying for some time, but decided to ask here. Sorry if this is an inapproptiate question.
int main (int argc, char** argv){
char szPathToExe[MAX_PATH];
GetModuleFileNameA(NULL, szPathToExe, MAX_PATH);
std::string path(szPathToExe);
path.append("other_argument");
char *n_argv = path.c_str();
argv = n_argv;
}
Any idea on how to approach this? Thank you in advance!