title: C: Why string variable accepts more characters than its size?
body: <p>I have following code and the out put:-</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  int main()
  {
  char pal_tmp[4];
  printf("Size of String Variable %d\n",sizeof(pal_tmp));
  strcpy(pal_tmp,"123456789");
  printf("Printing Extended Ascii: %s\n",pal_tmp);
  printf("Size of String Variable %d\n",sizeof(pal_tmp));
  }
  </code></pre>
  
  <p>Out put:-</p>
  
  <pre><code>Size of String Variable 4
  Printing Extended Ascii: 123456789
  Size of String Variable 4
  </code></pre>
  
  <p>My questions is Why String variable (character array) accepts characters more than what its capacity is? Should not it just print <code>1234</code> instead of <code>123456789</code> ?</p>
  
  <p>Am I doing something wrong?</p>