使用popen函数执行shell命令

标准I/O库提供了两个函数popen和pclose。 popen将会调用pipe建立一个管道,fork一个子进程,使用exec执行一个shell命令。(popen须要配合pclose使用)               #include <stdio.h>              FILE * popen(const char *cmdstring,const char *type); cmdst
相关文章
相关标签/搜索