title: Invalid memory reference (SIGSEGV) error
body: <p>I have the code:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  
  
  int main(int argc, char *argv[])
  {
  
      std::cout &lt;&lt; "test\n";
  
      std::string test = "test";
  
      if (test == argv[1]) {
          std::cout &lt;&lt; "a test";
      }
  
  
  }
  </code></pre>
  
  <p>I am running the code with g++ on Rextester: <code>g++ -Wall -std=c++11 -O2 -o a.out source_file.cpp</code>.</p>
  
  <p>I am getting the error <code>Invalid memory reference (SIGSEGV)</code>.</p>
  
  <p>Why am I getting this error?</p>
  
  <p>After compilation, I am running the code with the arguments <code>test 0.1</code>.</p>
  
  <p>Here is the code at Rextester: <a href="http://rextester.com/FGVB49226" rel="nofollow">http://rextester.com/FGVB49226</a>.</p>