title: Storing information from switch statement into a variable?
body: <p>I am trying to make a character customization program. I want to store the information received from the switch statement into storePlayerRace Variable. I am trying to pass that information as a reference. I don't know how if that's the right way of doing this. This problem is really bothering me since it should be so simple. Every time I run this the cout statement does not output any text to the screen. I want the race that was selected to output to the screen. Any related help is greatly appreciated! 
  **I am trying to break the scope of the switch statement. </p>
  
  <pre><code>#include &lt;iostream&gt;
      #include &lt;Windows.h&gt;
      #include &lt;string&gt;
      using namespace std;
  
      string characterName(string x){
          return x;
      }
      string characterRace(string &amp;x){
          return x;
      }
  
  
      int main()
      {
  
          string name;
          string storePlayerName;
          string storePlayerRace;
  
          int race;
          cout &lt;&lt; "&lt;------Character Creation-------&gt;" &lt;&lt; endl;
          cout &lt;&lt; "\n\n Enter Character name " &lt;&lt; endl;
          getline(cin,name);
          storePlayerName = characterName(name);
  
          cout &lt;&lt; "\n Select Race " &lt;&lt; endl;
          cout &lt;&lt; "1: White";
          cout &lt;&lt; "\n2: Black\n";
          cin &gt;&gt; race;
  
          switch(race){
              case 1:
                  {               
                      string white;
                      storePlayerRace = characterRace(white);
  
                  }break;
              case 2: 
                  {
                      string black;
                      storePlayerRace = characterRace(black);
                  }break;
          }
          cout &lt;&lt; storePlayerRace &lt;&lt; endl;
          cout &lt;&lt; "End of Program" &lt;&lt; endl;
          getchar();
          system("PAUSE");
      }
  </code></pre>