4
可能重複:
How can I run an external program from C and parse its output?如何從C++的Windows命令中讀取控制檯輸出?
如果你從你的程序中運行Windows命令(假設IPCONFIG爲例),你如何讀取輸出系統會給你回進入你的程序進行處理?
可能重複:
How can I run an external program from C and parse its output?如何從C++的Windows命令中讀取控制檯輸出?
如果你從你的程序中運行Windows命令(假設IPCONFIG爲例),你如何讀取輸出系統會給你回進入你的程序進行處理?
見Creating a Child Process with Redirected Input and Output MSDN上
或者,你可以使用_popen輸出的簡單拍攝。