title: I did not understand how to use chars in switches
body: <p>I just started the C language as my first language to seriously learn. I wanted to learn how switch works and I can do it with int values. When I try to use char, I did not get how it works.</p>
  <p>Here is what I tried:</p>
  <pre><code>char class;
  scanf(&quot;%s&quot;, class);
  switch(class){
      case 'm': printf(&quot;Math!\n&quot;); break;
  }
  </code></pre>
  <p>The things I have tried are:</p>
  <ol>
  <li><p>Using &quot;%c&quot; instead of &quot;%s&quot; in scanf</p>
  </li>
  <li><p>I made the 'char class;' --&gt; 'char class[2];', it said that switch case needed int value</p>
  </li>
  <li><p>I changed it back, then I put a '&amp;' front of 'class' in scanf function and it worked.</p>
  </li>
  </ol>
  <p>I made it work with trying but I didn't understand why it didn't work or why it worked last time I tried it. I thought that we only use '&amp;' with integers.</p>
  <p>Any help is more than welcomed, sorry if this is a stupid question but I searched the web and wasn't able to find an answer (Maybe I don't know the correct thing to search for, English is not my native language)</p>
  <p>-Thank you</p>