C++ system() function — How to collect the output of the issued command?

前端 未结 8 1672
暖寄归人
暖寄归人 2020-12-03 16:14

I\'m running some commands with the C++ system() function:

int system ( const char * command );

How can I collect the standard

8条回答
  •  南方客
    南方客 (楼主)
    2020-12-03 17:05

    I suggest the popen() functions, as said by other people as well, but this problem is platform specific. the popen() function is available on operating systems that use the POSIX API. I am not sure if this command would work on other APIs like WIN32

提交回复
热议问题