title: Equals returning false in c++
body: <p>I'm fairly new to cpp and I am trying to do a project. It says that the code must take in a filename as an argument and will be run by:</p>
  
  <pre><code>./main -i filename
  </code></pre>
  
  <p>I have written a for-loop that will iterate through the list of arguments to find the "-i" argument so that I can determine the filename. But this line always return false:</p>
  
  <pre><code>argv[i] == "-i"
  </code></pre>
  
  <p>Below is my code: </p>
  
  <pre><code>#include &lt;string&gt;
  #include &lt;iostream&gt;
  
  int main(int argc, char *argv[]) {
      std::string test = argv[0];
      for(int i = 0; i &lt; argc; i++){
          if(argv[i] == "-i"){
              test = argv[i+1];
              break;
          }
      }
      std::cout &lt;&lt; test;
      return 1;
  }
  </code></pre>