title: Navigating console menu
body: <p>I'm totally new and I don't know how else to ask this or what to even search for.</p>
  <p>The case is this: I want to navigate through a menu with several sub-menus. In this example I'll just use &quot;options&quot; and a &quot;game&quot; to illustrate what I mean. Say you have a menu with 3 options.</p>
  <blockquote>
  <p>1 - Start</p>
  <p>2 - Options</p>
  <p>3 - Quit</p>
  </blockquote>
  <p>Choosing options should take you to another menu. Which would then look something like</p>
  <blockquote>
  <p>1 - Difficulty</p>
  <p>2 - Sound</p>
  <p>3 - Back</p>
  </blockquote>
  <p>Depending on where you go from here, there will be more sub menus obviously.
  I've tried nesting do-while loops and all kinds of things but I just don't have enough understanding to know what it is I'm doing wrong.</p>
  <p>Here is what I have so far:</p>
  <pre><code>#include &lt;cstdlib&gt;
  #include &lt;iostream&gt;
  
  using namespace std;
  
  int main(int argc, char *argv[])
  {
    int choice;
  
      do{
      cout &lt;&lt; &quot;Main Menu\n&quot;;
      cout &lt;&lt; &quot;Please make your selection\n&quot;;
      cout &lt;&lt; &quot;1 - Start game\n&quot;;
      cout &lt;&lt; &quot;2 - Options\n&quot;;
      cout &lt;&lt; &quot;3 - Quit\n&quot;;
      cout &lt;&lt; &quot;Selection: &quot;;
      cin &gt;&gt; choice;
  
           switch(choice) {
             case 1:
               cout &lt;&lt; &quot;Pew pew!\n&quot;;
               break;
             case 2:
               cout &lt;&lt;&quot;????\n&quot;;
               break;
             case 3:
               cout &lt;&lt; &quot;Goodbye!&quot;;
               break;
             default:
               cout &lt;&lt; &quot;Main Menu\n&quot;;
               cout &lt;&lt; &quot;Please make your selection\n&quot;;
               cout &lt;&lt; &quot;1 - Start game\n&quot;;
               cout &lt;&lt; &quot;2 - Options\n&quot;;
               cout &lt;&lt; &quot;3 - Quit\n&quot;;
               cout &lt;&lt; &quot;Selection: &quot;;
               cin &gt;&gt; choice;    
           }
        } while(choice !=3);                            
      system(&quot;PAUSE&quot;);
      return EXIT_SUCCESS;
  }
  </code></pre>
  <p>Which works like a regular menu. But I have no idea where to go from here. I consulted some books, but finding anything even remotely related to this was completely random. Any help or examples would be greatly appreciated.</p>
  <p>What happened with nesting tons of loops just made all loops execute simultaneously every time. How do I keep this from happening? Making more choices? (choice1-2-3 etc ? or what?)</p>