title: array contents duplicate in C?
body: <p>I wrote a simple program to check if the method of declaring a string affects if a string terminator is added by default or not, however, I noticed that the contents of one array are copied to another. Why is this happening?</p>
  <pre><code>#include&lt;stdio.h&gt;
  #include&lt;string.h&gt;
  
  int main() {
      char *Name1 = &quot;Name1&quot;;
      char Name2[] = &quot;Name2&quot;;
      char Name3[] = {'N','a','m','e','3'};
      printf(&quot;Name1 = %lu\n&quot;,strlen(Name1));
      printf(&quot;%s\n&quot;,Name1);
      printf(&quot;Name2 = %lu\n&quot;,strlen(Name2));
      printf(&quot;%s\n&quot;,Name2);
      printf(&quot;Name3 = %lu\n&quot;,strlen(Name3));
      printf(&quot;%s\n&quot;,Name3);
      return 0;
  }
  # Name1 outputs 5 -&gt; Name1
  # Name2 outputs 5 -&gt; Name2
  # Name3 outputs 10 -&gt; Name3Name2
  </code></pre>