Reputation: 1116
How can I run a program programmaticaly through command line and get its return value? I would like to have a way that works on both Windows 7 and MacOS X, but if I need to program it differently per OS I would do that too
Upvotes: 0
Views: 740
Reputation: 3276
You can use system to call a program and retrieve its return value.
An example would be
int returnValue = system("C:\\SomeProgram.exe");
Upvotes: 3