0

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?

4
  • 2
    The answer to this is OS dependent. Which OSes are you targeting? Commented Apr 14, 2014 at 17:00
  • Please look at [stackoverflow.com/questions/9550488/…. It explains the same issue. [1]: stackoverflow.com/questions/9550488/… Commented Apr 14, 2014 at 17:04
  • 1
    It is always possible that if you try to describe what you are attempting to achieve, someone could recommend a better way of accomplishing your goal. Commented Apr 14, 2014 at 17:07
  • is it worth it to make a program just for that ? why not just write a shell script ? Commented Apr 14, 2014 at 17:19

1 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.