我想要做的是让我的 C++ 代码打开 Mplus(我在我的计算机上下载的统计程序)并运行它。可能吗?
最佳答案
你可以通过调用 std::system() 来做你想做的事情,比如:
std::system("program -e input_commands.txt"); // Assuming it accepts some sort of command line args
std::system("program < input_commands.txt"); // Assuming it responds to stdin
这种方法是否有效取决于程序。
关于c++ - 是否可以使用 C++ 执行另一个程序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23065916/