title: strcpy function not working properly
body: <p>Please consider the below code.</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  #include&lt;string.h&gt;
  void main()
  {
      char a[6], b[6];
  
      strcpy(a,"rajeev");
      printf("print A:");
      for(int i=0;i&lt;strlen(a);i++)
      {
           printf("%c",a[i]);
      }
  
      strcpy(b,a);
      printf("print B:");
      for(int i=0;i&lt;strlen(b);i++)
      {
          printf("%c",b[i]);
      }
  
      printf("trying to print A again");
      for(int i=0;i&lt;strlen(a);i++)
      {
          printf("%c",a[i]);
      }
  </code></pre>
  
  <p>While running this program,in the "trying to print A again" section prints nothing, and the <code>strlen(a)</code> will be 0.  That means the source array will be empty.</p>
  
  <p>Can you please help me to understand the phenomena behind this?
  But, change the declaration of <code>a[6]</code> to <code>char* a=malloc(6)</code> works properly.</p>