title: Checking if a char is a newline
body: <p>I'm doing an exercise in C++ Primer and basically I am using a switch statement to count the number of vowels in a text that I input. </p>
  
  <p>I input the text using a while loop.</p>
  
  <pre><code>while(cin &gt;&gt; ch)
  </code></pre>
  
  <p>and proceed with the cases, a, e, i, o, u, incrementing an integer variable for the respective cases. Now the next part of the question says also count the spaces, tabs and newlines.</p>
  
  <p>I tried doing</p>
  
  <pre><code>case ' ':
  </code></pre>
  
  <p>and so forth using '\t' and '\n'. But it seems like it doesn't compute these cases. I also tried just using a default and using an if else statement</p>
  
  <pre><code>default:
      if(ch == ' ')
          ++space;
  </code></pre>
  
  <p>etc. But this doesn't proceed either. I also tried putting in the integer values of ' ', '\t', '\n'. What am I doing wrong here? Also, I know that if I use isspace() I can count the combined total but I need to compute each one individually. I'm not sure why the equality test won't do the job.</p>