title: C++ function that returns value into switch statement
body: <p>Currently I have a working program, but am trying different things to see if they work. below is the code I am trying to get to work but having  a function that asks the user to make a selection. I want to return that value into my main function which will run a do while loop that includes a case. Originally I have it as an if else if statement, but want to cut that down if possible. Below is the code I am working with. When running the program it only returns the entire menu instead of running the function from the value that should be returned.</p>
  
  <p><code>     </p>
  
  <pre><code> {
          int choice;
          createEmptySeats();
          seatPrice();
  
          do {
              choice = menu();
              switch (choice)
              {
              case '1': 
                  reserveSeat();
                  break;
              case '2': 
                  displayInfo();
                  break;
              case '3': 
                  DisplaySummary();
                  break;
              case '4': 
                  break;
              }
          }
          while (!seatFull());
  
          return 0;
      }
  
  
          int menu() 
          {
              int userSelection = -1;
              while (userSelection &lt; 1 || userSelection &gt; 4) 
              {
                  cout &lt;&lt; "Please Choose Option Below" &lt;&lt; endl;
                  cout &lt;&lt; "1: Reserve Seat(s)"&lt;&lt;endl;
                  cout &lt;&lt; "2: Display Available Seats" &lt;&lt; endl;
                  cout &lt;&lt; "3: Display Information:" &lt;&lt; endl;
                  cout &lt;&lt; "4: Exit System" &lt;&lt; endl;
                  cin &gt;&gt; userSelection;
              }
              return userSelection;
          }
  </code></pre>
  
  <p></code></p>