Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
コマンドラインからプログラムをプログラムで実行し、その戻り値を取得するにはどうすればよいですか? Windows 7 と MacOS X の両方で動作する方法が必要ですが、OS ごとに異なるプログラムを作成する必要がある場合は、それも行います。
systemを使用してプログラムを呼び出し、その戻り値を取得できます。
例は
int returnValue = system("C:\\SomeProgram.exe");