system function introduce:
//come from /usr/include/stdlib.h
Execute the given line as a shell command
extern int system(__const char* __command)
system以新进程方式运行一个程序,然后结束。system()函数用来创建新进程,并
在此进程中运行新进程,直到此进程结束后,才继续运行父进程。子进程退出后,会返回退出状态
#include <stdlib.h>
#include <stdio.h>
int main()
{
int status;
status=system("pwd");
printf("\nstatus=%d\n",status);
return 0;
}

800

被折叠的 条评论
为什么被折叠?



