linux 中如何在源代码中调用另一个程序?
3 回答

慕沐林林
TA贡献2016条经验 获得超9个赞
可以啊,看你是想用shell,还是c++都可以啊
shell写脚本就不用说了,
C++的话可以调用类似system(“SAC”);的函数
另外,应该有SAC 在命令中直接打开file1的选项,你可以SAC --help看看

Cats萌萌
TA贡献1805条经验 获得超9个赞
比如那个程序是D:\program.exe
那么加入语句
system("D:\\program.exe");//(双反斜杠是因为转义字符)
或者:
system("start D:\\program.exe");
要求#include <stdlib.h>
或者#include <cstdlib>并using namespace std;
添加回答
举报
0/150
提交
取消