title: Need to read white space and other chars C++
body: <p>I have been working on this all day with no luck. Its night now and don't know what to do. My assignment is to read number of vowels, number of white spaces, and number of other characters in a user inputted sentence. I know i need to use cin.get(ch) for whitespaces, but don't know how. I also need to output the sentence to a file. Heres what I have so far:</p>
  
  <pre><code>//Get data from user 
  cout &lt;&lt; "Enter your sentence on one line followed by a # to end it: " &lt;&lt; endl;
  
  
  
  while (cin &gt;&gt; noskipws &gt;&gt; character &amp;&amp; character != '#')
  {
      character = static_cast&lt;char&gt;(toupper(character));
  
      if (character == 'A' || character == 'E' || character == 'I' ||
              character == 'O' ||  character == 'U')
      {
          vowelCount++;
          isVowel = true;
  
      }
  
      if (isspace(character))
      {
          whiteSpace++;
  
      }
  
      else if (isVowel == true &amp;&amp; isspace(character))
      {
          otherChars++;
      }
  
      outFile &lt;&lt; character;
  
  }
  
  
  outFile &lt;&lt; "vowelCount: " &lt;&lt; vowelCount &lt;&lt; endl;
  outFile &lt;&lt; "whiteSpace: " &lt;&lt; whiteSpace &lt;&lt; endl;
  outFile &lt;&lt; "otherchars: " &lt;&lt; otherChars &lt;&lt; endl;
  </code></pre>