title: Why can't compare two strings in if condition?
body: <p>Why can't compare two strings in <code>if</code> condition?</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string.h&gt;
  
  using namespace std;
  
  int main() {
    string  sexo[20], feminino; 
    feminino = "f";
  
    for (int i = 0; i &lt; 3; i++) {  
      do {
        cout &lt;&lt; endl &lt;&lt; "enter your " &lt;&lt; i + 1 &lt;&lt; "sexo: ";
        cin &gt;&gt; sexo[i];
  
        if (strcmp(sexo[i], feminino)==0){ // problem in here     
          cout &lt;&lt; "that's ok" &lt;&lt; endl;
        }
  
      } while (nome[i] == "0");
    }
    return 0;
  }
  </code></pre>