#include <cstdlib>
#include <iostream>
#include <string>
using namespace std;
int main(int argc, char* argv[])
{
cout << "test1" << endl;
string cmd = "./test2";
int status = system(cmd.c_str());
cout << WEXITSTATUS(status) << endl;
return 0;
}
从system返回值中获得程序退出码
最新推荐文章于 2022-12-02 22:39:40 发布