0

How do I take an already - compiled program (Console App) and communicate with it via my C++ code? Such that "printing" into the program will be the same as a user that types what I print into the console of the program, and "reading" from it read what the program as written into the console?

Here is a pseudocode of what I want (preferably without external libraries):

//also start (run) the program somehow
ProgramStream programStream = createStream("somepath/someprogram.exe")

programStream << "This will be written into the console of someprogram.exe" <<endl;

string result;
ProgramStream >> result; //gets what the program prints back


Botje
  • 26,269
  • 3
  • 31
  • 41
Aviv Vetaro
  • 363
  • 5
  • 12

0 Answers0