title: How to get an element from argv[]
body: <p>This is C++</p>
  
  <p>At the windows cmd line user types</p>
  
  <pre><code>p3.exe X &lt;data.txt
  </code></pre>
  
  <p>where "p3.exe" is the program name,</p>
  
  <p>"X" will be a 1, 2, or 3,</p>
  
  <p>and "data.txt" is some text file program uses for input.</p>
  
  <p>Inside the main method, I'm expecting argv[1] to equal the string X typed at the cmd line.  In fact, if I do</p>
  
  <pre><code>wcout &lt;&lt; argv[1]
  </code></pre>
  
  <p>the output is "X" as expected.</p>
  
  <p>So now I do this, </p>
  
  <pre><code>int main(int argc, char* argv[])
  {
       if (argc &gt; 1)
       {
            if (argv[1] == "X")
            {
                //do stuff
            }
       }
       return 0;
  }   // end main
  </code></pre>
  
  <p>But (argv[1] == "X") never evaluates to true</p>
  
  <p>What am i missing or not understanding?</p>