title: Testing for a space character inside a string...?
body: <p>I'm trying to test if a character in a string is a space, and I'm getting extremely frustrated:</p>
  
  <pre><code>string my_string;
  cin &gt;&gt; my_string;
  for (int i = 0; i &lt; my_string.length(); i++)
      {
          if (my_string[i] == ' ') // this never becomes true...
          {
              cout &lt;&lt; "this text should pop, but never does" &lt;&lt; endl;
          }
      }
  </code></pre>
  
  <p>I'm not getting any errors and I've looked online, but people on different forums say this is how to test for a space. Uh.</p>