DEV C++怎么用

来源:百度知道 编辑:UC知道 时间:2024/05/23 20:42:08
刚刚开始接触 C++ 用DEV 4.9.9.2编译好程序后 运行了就闪一下 要在程序里输入 char response cin >>response 这个东西才能显示在电脑上 不知道怎么设置成不输入这些东西就可以直接显示在电脑上
我就是不希望在return 0前输入任何东西就可以直接输入在电脑上啊。难道DEV C++没这功能?

想在哪里停就在哪里用system("PAUSE");
也可以用DEV编译好了后用cmd命令运行,这样就停住了

return 0;前面加上system("pause");就行了

你也可以
#include <conio.h>
然后在return 0;前面加上getch();

system("pause");的作用是使屏幕静止,如果不加这一句输出时候一样会显示,但是会一闪而过

#include <stdlib.h>
#include <iostream>

using namespace std;

int main() {
cout << "hello world" << endl;
system("pause");
return 0;
}

【可以这样写】

#include<iostream.h>
int main()
{

cout << "测试成功!" << endl ;
//其他代码

system("pause");
return 0 ;

}

#include <stdlib.h>

int main(void) {
system("pause");
return 0;
}