Return to Menu

This is a discussion on Return to Menu within the C++ Programming forums, part of the General Programming Boards category; Hi, I have a quick question, when I do a menu with switch, how can I return to the original ...

  1. #1
    Unregistered
    Guest

    Cool Return to Menu

    Hi,

    I have a quick question, when I do a menu with switch, how can I return to the original menu after I go to another place? For example if I choose the first option on the menu it takes me to another function, how can I return to the original menu and choose something else?

  2. #2
    zen
    zen is offline
    of Zen Hall zen's Avatar
    Join Date
    Aug 2001
    Posts
    1,007
    Enclose your switch code in a while loop, so everytime one of the menu functions is executed the code returns to the top. You could set a 'quit' option within your switch that will cause the while condition to return false and exit.
    zen

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. is it ok like that?
    By ExDHaos in forum C++ Programming
    Replies: 8
    Last Post: 05-23-2009, 10:02 AM
  2. 6 measly errors
    By beene in forum Game Programming
    Replies: 11
    Last Post: 11-14-2006, 11:06 AM
  3. C++ FTP class won't work
    By lord mazdak in forum C++ Programming
    Replies: 8
    Last Post: 12-18-2005, 07:57 AM
  4. Best "Menu" method?
    By SSJMetroid in forum Game Programming
    Replies: 11
    Last Post: 12-08-2005, 12:05 AM
  5. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 04:00 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21