title: While loop will not break in C++
body: <p>Hey im making a game in C++.  It's college work and the brief states no use of header files and the game must be basic.  The problem is,  after the game ends its still asking for a choice.  Ive tried to break, exit and still no joy.  The program will not exit.
  Can anyone help me with this?</p>
  
  <p>Here is my code:
  Main</p>
  
  <pre><code>int main()          //  The main function is set to int.  
      //  The return value has to be an integer value.
  {
      menuText();
      while(menu)     // Loop to revert back to menu when choice is not compatable with options.
      {
          int selection;
          cout&lt;&lt; "Choice: ";
          cin&gt;&gt; selection;
  
          switch(selection)
          {
          case 1: 
              cout &lt;&lt; "Start Game\n";
              playGame();
              break;
          case 2:
              cout &lt;&lt; "Exit Game\n";
              cout &lt;&lt; "Please press enter to exit...\n";
              menu = false ;
              break;
          }
      }
  
  
      system("pause");    //  To stop the program from exiting prematurely.
      return 0;           //  this is needed because the main is set to return
      //  an integer.
  }
  
  int playgame()
  status Status = {100,20,80,80,20};// declaration of class members.
      //Contents of PlayGame().............................
      exitGame();
      return 0;
  }
  void exitGame()
  {
      cout &lt;&lt; "\n\nPlease press enter to exit the game.";
      return;
  
  }
  </code></pre>