에서 계속합니다.보도 anykey 리눅스에있는 것은 어떤 다른를 취하면 나는 잘 모르겠지만, 내가이 것을 온라인으로 발견 리눅스 C++
그러나 내 프로그램에서 작동하지 않는 것 같습니다.
컴파일되고 실행되지만 기다리지 않습니다.
기본적으로, 나는 화면에 사람들의 목록을 표시하는 메서드 호출로 이어지는 메뉴가 있습니다. 시스템이 메뉴로 돌아 가기 전에 목록을 일시 중지하고 싶습니다.
//Manager's Menu
void SelectionPage::showManagerMenu(){
char option;
while(true)
{
system("clear"); //Clears the terminal
cout<<" Flat Manager's Menu"<<endl<<endl; //Display manager's menu
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" <<endl;
cout << "e) Resources" <<endl;
cout << "f) Reset System" <<endl;
cout << "q) Exit" << endl;
cout << "make selection: ";
cin >> option;
switch(option) { //Takes the user to the corresponding menu or method
case 'a': system("clear");
memberList.addNewFlatMember(points);
break;
case 'b': system("clear");
memberList.deleteFlatMember();
break;
case 'c': system("clear");
memberList.listFlatMembers();
break;
case 'd': system("clear");
showDutiesMenu();
break;
case 'e': system("clear");
showResourcesMenu();
break;
case 'f': //reset();
break;
case 'q': exit(0);
default: cout << "Option not recognised: " << option << endl;
showManagerMenu();
}
}
}
내가 선택하려는 옵션으로 C)로 연결 : 여기에
메뉴에서 내 코드입니다//Show the current flat population
void MemberManagement::listFlatMembers(){
cout<<" Member List"<<endl<<endl;
importFlatMembers(); //get flat member info from file
for(int count = 0; count<flatMemberList.size(); count++){
cout << count+1<<". "<<flatMemberList[count].getName() << endl;
}
cout << "Press any key to Continue...";
cin.ignore(numeric_limits<streamsize>::max(),'\n');
return;
}
당신이 내 코드의 다른 비트를보고 싶다면 나를 알려 주시기 바랍니다.
미리 감사드립니다.
Rob의 규칙 # 47 : '\ n'을 (를) 의미하는 경우 'endl'이라고 말하지 마십시오. http://stackoverflow.com/questions/5492380/what-is-the-c-iostream-endl-fiasco –