如果在Linux Terminal 里面 man system 大家可以看到system()函数的用法,非常简单:函数声明如下:

int system(const char *command);

  函数失败则返回-1,成功后返回0。

  例:

system("echo hello > hello.txt") /*将hello 写入到hello.txt*/

相关文章: