文件头:#include <stdlib.h> int system(const char *command); 功能:在已经运行的程序中执行另外一个外部程序 参数:外部可执行程序名字 返回值: 成功:0 失败:任意数字
示例代码: #include <stdio.h> #include <stdlib.h> int main() { //system("calc"); //windows平台 system("ls"); //Linux平台, 需要头文件#include <stdlib.h> return 0; }
|