title: Curious array overwrite
body: <p>I wrote the following c program:</p>
  
  <pre><code>int main() 
   {
       char a[1];
       char b[6]="hello\0";
       int c,  i;
  
       for(i = 0; (c = getchar()) != EOF; i++) 
           a[i] = c;
       for(i = 0; i  &lt; 5; i++) 
           printf("%c", b[i]);
  
   }
  </code></pre>
  
  <p>Why when I give "bye" in input the program print "helby"? 
  I thought 'b' should be saved in a[0], 'y' in b[0] and 'e' in b[1].
  Thank you in advice! </p>