我不确定在Linux中是否有任何不同,但我在网上发现这个:
cout << "Press Enter to Continue...";
cin.ignore(numeric_limits::max(),'
');
应该足够了,当然在标题中加上#include。
但是,它似乎在我的程序中不起作用。
它编译,运行,但它不等待。
基本上,我有一个菜单,导致方法调用显示屏幕上的人员列表。我希望在系统返回菜单之前暂停该列表。
这是菜单中的代码:
//Manager's Menu
void SelectionPage::showManagerMenu(){
char option;
while(true)
{
system("clear"); //Clears the terminal
cout<
cout << "Select Manager option" << endl;
cout << "a) Add a new Flat Member" << endl;
cout << "b) Delete an existing Flat Member" << endl;
cout << "c) List Flat Members" << endl;
cout << "d) Duties" <
cout << &