title: const char* vs const char[]
body: <p>As far as I know , a string literal like "Hello"</p>
  
  <p>is considered a <code>char*</code> in C and a <code>const char*</code> in C++ and for both languages the string literals are stored in <em>read-only</em> memory.(please correct me if I am wrong)</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main(void)
  {
      const char* c1;
      const char* c2;
  
      {
          const char* source1 = "Hello";
          c1 = source1;
  
          const char source2[] = "Hi"; //isn't "Hi" in the same memory region as "Hello" ?
          c2 = source2;
      }
  
      printf("c1 = %s\n", c1); // prints Hello
      printf("c2 = %s\n", c2); // prints garbage
  
      return 0;
  }
  </code></pre>
  
  <p>Why <em>source1</em> and <em>source2</em> behave differently ?<em>(compiled with gcc -std=c11 -W -O3)</em></p>