cin.get();
cin.get();//如果程序在常规输入后留下了一个没有被处理的键击
return 0;
让程序等待,直到按下了enter键
#include <iostream>
using namespace std;
int main()
{
cout << "Come up and C++ me some time." ;
cout << endl;
cout << " You won't regret it!"<<endl;
cin.get();
return 0;
}
本文介绍了一种在C++程序中使用`cin.get()`来暂停程序直至用户按下Enter键的方法。通过这种方式,可以让程序等待用户的输入信号再继续执行,这对于调试或者查看中间结果非常有用。

被折叠的 条评论
为什么被折叠?



