Also note that you have infinate mutual recursion going on. While this is valid and clever in fancy functional proramming langauges, we don't do such things here in C++, here we are programming a computer, not solving lamda calculus. The C++ version would look something like this
Code:
int display_menu()
{
//... as written
int choice=0;
cin>>choice;
return choice;
}
void display_choice(int choice)
{
//.. as written, but no display_menu()
//.. no return 0; void functions do not need
// .. a return, you can have one, but it's just
// return; by itself.
}
int main() {
for(int choice=display_menu(); choice != 0; choice = display_menu()) display_choice(choice);
return 0;
}
The changes to the display_menu() have a mild amount of trickery. Here we rely on the fact that if a stream encounters bad input it does not change the value it's trying to write to. In our case if the user enters 'Q' in responce to the menu then display_menu() returns zero. We also have the side effects that cin.good() is false and we still have a 'Q' sitting in the input buffer, but we don't care about that right now. Stream driven menus are generally awkward to work with.