【发布时间】:2010-07-07 17:21:32
【问题描述】:
我需要在 c++(windows)中控制一个程序,我需要调用它,然后在收集它时将数据传递给它,最后在某个命令之后程序将使用该数据。
我需要打开prog.exe,然后逐行或逐值提供信息,它通过cmd手动工作。
我已经尝试过 system() 但打开程序后它会停止。
我需要这样的东西。
//call it
prog.exe
//add data
DataStart
Data 1 [2 34 454 5]//etc
DataEnd //the program will take it from here.
全部通过命令行传递
【问题讨论】:
-
只从标准输入读取。
-
你的意思是,
prog.exe会从标准输入读取数据吗?你可能是这个意思。 -
与stackoverflow.com/questions/450865/… 不完全相同,但答案应该很有用。
标签: c++ shell command-line controls