title: c++ string iterator
body: <p>I'm trying to do an if statement inside a loop with an iterator over a string, but can't figure out how to get the current character for the if statement:</p>
  
  <pre><code>for (std::string::iterator i=buffer.end()-1; i&gt;=buffer.begin(); --i) {
      if (!isalpha(*i) &amp;&amp; !isdigit(*i)) {
          if(i != "-") { // obviously this is wrong
              buffer.erase(i);
          }
      }
  }
  </code></pre>
  
  <p>Can someone help me get the current character so I can do some additional if statements?</p>