title: error: switch quantity not an integer C++
body: <p>I have a problem while trying to compile my C++ code. As I am still learning C++, I still do not understand most of the advanced commands yet. I was trying to create a program which asks the user's first name, last name, age and gender and displaying it back to the user. This is my source code:</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  int main ()
  {
      char firstName[20];
      char lastName[20];
      char age[6];
      char gender[3];
  
      int i = 0;
  
      std::cout &lt;&lt; "Please enter your full name: ";
      std::cin.getline (firstName, 19, ' ');
      std::cin.getline (lastName, 19);
  
      std::cout &lt;&lt; "Enter your age: ";
      std::cin.getline (age, 5);
  
      while (i != 1)
      {
          std::cout &lt;&lt; "Enter your gender (m/f)";
          std::cin.getline (gender, 2);
  
          switch (gender)
          {
              case 'm':
                  std::cout &lt;&lt; "\nHello Mr. ";
                  i++;
                  break;
  
              case 'f':
                  std::cout &lt;&lt; "\nHello Mrs. ";
                  i++;
                  break;
  
              default:
                  std::cout &lt;&lt; "\nThat is not even a gender!\n";
                  break;
          }
      }
  
      std::cout &lt;&lt; lastName &lt;&lt; "!\n";
      std::cout &lt;&lt; "You are " &lt;&lt; age &lt;&lt; " years old.";
  
      return 0;
  }
  </code></pre>
  
  <p>When I tried to compile this, my compiler gives me the following error:</p>
  
  <pre><code>NameAgeQ.cpp: In function 'int main()':
  NameAgeQ.cpp:24:15: error: switch quantity not an integer
  </code></pre>
  
  <p>I've tried to code another programs with the 'switch' statements before and it can handle characters. However, in the previous programs I would declare 'gender' as 'char gender;' instead of 'char gender [];'.</p>
  
  <p>Why in this particular case the 'switch' statement doesn't work? Does it not support the array string?</p>