title: How strcpy works behind the scenes?
body: <p>This may be a very basic question for some. I was trying to understand how strcpy works actually behind the scenes. for example, in this code</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  int main ()
  {
    char s[6] = "Hello";
    char a[20] = "world isnsadsdas";
    strcpy(s,a);
  
    printf("%s\n",s);
    printf("%d\n", sizeof(s));
    return 0;
  }
  </code></pre>
  
  <p>As I am declaring <code>s</code> to be a static array with size less than that of source. I thought it wont print the whole word, but it did print <code>world isnsadsdas</code> .. So, I thought that this strcpy function might be allocating new size if destination is less than the source. But now, when I check sizeof(s), it is still 6, but it is printing out more than that. Hows that working actually?</p>