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