title: How can different strings have the same address
body: <p>I know that in order to compare two strings in C, you need to use the <code>strcmp()</code> function.
  But I tried to compare two strings with the <code>==</code> operator, and it worked. I don't know how, because it just compares the address of the two strings. It shouldn't work if the strings are different. But then I printed the address of the strings:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  int main()
  {
      char* str1 = "First";
      char* str2 = "Second";
      char* str3 = "First";
  
      printf("%p %p %p", str1, str2, str3);
  
      return 0;
  }
  </code></pre>
  
  <p>And the output was:</p>
  
  <pre><code>00403024 0040302A 00403024
  Process returned 0 (0x0)   execution time : 0.109 s
  Press any key to continue.
  </code></pre>
  
  <p>How is it possible that <code>str1</code> and <code>str3</code> have the same address? They may contain the same string, but they aren't the same variable.</p>