title: How to check if a character in a string equals "w"
body: <p>I am failing to compare characters of a string in my program, I made a simpler version to showcase the problem:</p>
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  
  int main() {
          string s = &quot;Hello world!&quot;;
  
          for(int i = 0; i&lt;s.size(); i++) {
                  if(s[i] == &quot;w&quot;) {
                          cout &lt;&lt; &quot;This is a w!&quot; &lt;&lt; endl;
                  }
          }
  }
  
  </code></pre>
  <p>It returns this error:</p>
  <blockquote>
  <p>so.cpp:10:25: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
  10 |                 if(s[i] == &quot;w&quot;)</p>
  </blockquote>