I am a bit stuck on this one. My loop gets stuck in an infinite loop when it
finds the 'team'. Here's the code.
Any ideas to why its doing this? Any help is appreciated!
finds the 'team'. Here's the code.
//overlaoded operator bool operator == ( const FootballTeam& team ) { if ( city == team.city ) return true ; return false; } //search for team void searchTeam ( List<FootballTeam>& display ) { FootballTeam team; string input; bool found = false; cout<<"Enter the city of the team to display: "; getline ( cin, input); while ( input != "N/A" ) { team.city = input; found = display.getMember(team); if(found) { cout << team; } else { cout<<"That team is not found \n"; cout<<"Enter city again: "; getline ( cin , input ); cout << endl; } cout << endl; } }
Any ideas to why its doing this? Any help is appreciated!