title: c++ same strings not equal (char* actually)
body: <p>I have a problem with passing an argument into my program, seems to not be equal to what I put in as argument, except they're identical. Turning them into a string makes them identical, but I would like to know why the initial duo isn't.</p>
  
  <p>Here's my code:</p>
  
  <pre><code>int main(int argc, char *argv[]) {
    if (argc&gt;1) {
      cout &lt;&lt; "#" &lt;&lt; argv[1] &lt;&lt; "#" &lt;&lt; endl;
      cout &lt;&lt; "#" &lt;&lt; "nomast" &lt;&lt; "#" &lt;&lt; endl;
      cout &lt;&lt; (argv[1] == "nomast" ? "equal" : "not equal") &lt;&lt; endl;
  
      string s1 = argv[1];
      string s2 = "nomast";
      cout &lt;&lt; (s1 == s2 ? "equal after all" : "nope") &lt;&lt; endl;
      system("pause");
    }
    return 0;
  }
  </code></pre>
  
  <p>When I launch the compiled code with "call thingy.exe nomast" I get the output</p>
  
  <pre><code>#nomast#
  #nomast#
  not equal
  equal after all
  Press any key to continue . . .
  </code></pre>
  
  <p>My best idea is that I'm not handling the "char *argv[]" properly. Don't know how to handle it differently though.</p>