<cstdlib>定义了系统控制函数
void abort();异常终止程序
void exit(int status);终止当前程序
int system(char* command);执行shell命令
写一个系统控制函数的调用,用到system()函数
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
//梁笔记 //zouzhongliang.com #include <iostream> #include <cstdlib> using namespace std; int main() { system("type Test_code.cpp"); system("pause"); return 0; } |
system()系统控制函数调用测试结果:
system(“type? 文件名”);这条语句可以将文件中的内容输出。