I want to open a program (that has terminal like CMD) with a C++ code, but when I try System() and that program opens, my C++ code get stuck until I close the program and the rest of the code will execute. I want to open a program that is a terminal and after opening, I want to send some commandS to program to execute it. how can I:
1 - Continue to the rest of the C++ code after calling System() function
2 - Send a command to program using C++ code.
3 - receive command result
Here is the simple code that I use:
#include <iostream>
int main()
{
system("path of the program");
while(true)
{
// some commands that I want to send to terminal
// receive result
//....
}
}