title: Visual C++, wchar_t* command-line arguments cannot be compared?
body: <p>I am having a little bit of trouble trying to implement a certain assignment based on which string argv[1] equals.</p>
  
  <pre><code>int _tmain(int argc, _TCHAR* argv[]) //wchar_t
  {   
      if (argc != 2)
          exit(1);
  
      if (argv[1] == L"-foo")
          printf("Success!\n");
  
      wprintf(argv[1]);
      printf("\n");
  
      system("pause");
      return 0;
  }
  </code></pre>
  
  <p>If I run the executable with the argument "-foo", I receive the following output:</p>
  
  <pre><code>-foo
  </code></pre>
  
  <p>It should be:</p>
  
  <pre><code>Success!
  -foo
  </code></pre>
  
  <p>The string is exactly how I want it to be, but the if-condition remains to be false. Are <code>wchar_t</code> strings simply not comparable using the <code>==</code> operator? If so, how do I compare them properly?</p>