该计划的退出代码调用可以与获取
WEXITSTATUS(status)具体根据手册页。另请参见手册页
wait。
int status = system("/path/to/my/program");if (status < 0) std::cout << "Error: " << strerror(errno) << 'n';else{ if (WIFEXITED(status)) std::cout << "Program returned normally, exit pre " << WEXITSTATUS(status) << 'n'; else std::cout << "Program exited abnormalyn";}


