C语言中system("pause")是什么作用?
来源:互联网 发布:sql语句中not in 编辑:程序博客网 时间:2024/06/07 09:45
system就是调用从程序中调用系统命令(和shell命令)。
system("pause")就是从程序里调用“pause”命令;
而“pause”这个系统命令的功能很简单,就是在命令行上输出一行类似于“Press any key to exit”或“请按任意键继续...”的字,等待用户按一个键,然后返回。
【赠送查找数字源代码】
#include <stdio.h>#include <stdlib.h>#include <time.h>#define N 20int main(){int arr[N], x, n, i;int f = -1;srand(time(NULL));for (i=0;i<N;i++){arr[i] = rand() / 1000;}printf("输入要查找的整数:");scanf("%d",&x);for (i = 0; i < N; i++){if (x==arr[i]){f = i;break;}}printf("\n随机生成的数据序列:\n");for (i=0;i<N;i++){printf("%d ",arr[i]);}printf("\n\n");if (f < 0){printf("没找到数据:%d\n",x);}else{printf("数据:%d 位于数组的第%d个元素.\n",x,f+1);}system("pause");return 0;}
【显示结果】
阅读全文
0 0
- C语言中system("pause")是什么作用?
- C system("PAUSE") 小议
- 在C语言中,static关键字的作用是什么?
- c++中的system("pause")的作用
- system("Pause")
- system("pause")
- system("pause");
- system("pause");
- system pause
- system("pause")
- system(“PAUSE”)
- system("pause")
- system("pause")
- c语言中##作用
- Linux代码中添加System Pause 断点
- 【C语言】【unix c】pause(2)使用
- C语言中EOF是什么?
- C语言中include是什么?
- 关于使用nginx静态代理遇到的问题
- 《javascript面向对象编程指南》
- 《理想三旬》
- QML之Rectangle属性
- Yii2::上传图片
- C语言中system("pause")是什么作用?
- 关于字符串报java.lang.NullPointerException
- Xcode 【Xcode中关于自定义代码块的使用和删除】
- centos7+postfix+devocot+cycus-sasl搭建邮箱服务器
- 元注解和使用实例
- 图像纹理特提取与识别
- .NET Expression 从零开始二:数组与对象索引器
- EOS删除选中行
- Redis快照持久化