menu

please in menu driven programs, how do i get out of a particular menu after execution under that same menu to return to the previous menu in the program.......
what i mean is getting out of a submenu after execution under the submenu to go back to the direct previous menu.........
Assuming you are working in the console...

1
2
3
4
5
6
7
8
9
10
11
12
13
14
void MainMenu()
{
  // .. menu stuff
  if( user_wants_to_enter_submenu )
  {
    SubMenu();
    // when the SubMenu function returns, code will proceed from here
  }
}

void SubMenu()
{
  // submenu stuff
}
thanks for the reply, but i am new to C++, please pardon me if i sound stupid...

what i actually want for instance in your example, if i have another submenu named belowmenu, under the submenu u have in there, how do i goback from the belowmenu to the Submenu then to the MainMenu.......i dont know if i am making sense
use a loop, then when your submenu exits, it's just back in the main menu again.
Topic archived. No new replies allowed.