Linux C system()函数

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

int system(const char *command);

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

  例:

system("echo hello > hello.txt") /*将hello 写入到hello.txt*/
posted @ 2013-11-19 13:42  永久指针  阅读(1672)  评论(0编辑  收藏  举报