mercredi 30 avril 2014

Error in opening a file through system() C++


Vote count:

0




I'm trying to run a file using system() function with C++. It opened up the command prompt but it says that 'C:\Program' is not recognised as internal or external command.


I tried to manually open the CMD and typing this into it and it can run.



"C:\Program Files\MATLAB\R2011a\bin\matlab.exe" -r "run('C:\Users\victor\Desktop\FYP MATLAB\MATLAB 29april\main.m');"


but when use MSVC++ with this function it failed.



system("\"C:\\Program Files\\MATLAB\\R2011a\\bin\\matlab.exe\\\" -r \"run('C:\\Users\\victor\\Desktop\\FYP MATLAB\\MATLAB 29april\\main.m');\"");


I already used \" for " and \ instead of \


Please help. thanks



asked 1 min ago






Aucun commentaire:

Enregistrer un commentaire