Jacob Curtis
Jacob Curtis

Reputation: 808

Is it possible to execute another program using C++?

What I'd like to do is have my C++ code open up Mplus (statistical program that I've downloaded on my computer) and run it. Is it possible?

Upvotes: 0

Views: 110

Answers (1)

metal
metal

Reputation: 6332

You may be able to do what you want with std::system() calls like:

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

It depends on the program if this approach will work.

Upvotes: 2

Related Questions