c++ - Issue using system() on Windows -
this question has reply here:
c++ system() not working when there spaces in 2 different parameters 1 replyi have c++ programme trying phone call executable 2 parameters. code works fine on mac, have issues on windows. i'm confident issue related spaces in parameters because when utilize path no spaces works fine.
furthermore, print out i'm sending system()
, run printout on command line , works fine trifling.
i create phone call this: ret = system(cmd.c_str());
and if do: cout << cmd << endl;
i'll this:
"c:\program files (x86)\myprogram\some_executable.exe" "c:\users\me\desktop\files"
i'm not sure why quotes aren't helping, including quotes around paths in system()
call. printout of cmd i'm trying run doesn't work. however, if path had no spaces in it, execute fine.
any suggestions on passing parameters spaces system()
call?
after more research, issue related windows beingness stupid. scheme phone call removes first , lastly quote, had wrap whole thing in set of quotes...i found solution here: c++ system() not working when there spaces in 2 different parameters
c++ exe quotes
No comments:
Post a Comment