title: How much memory is reserved when i declare a string?
body: <p>What exactly happens, in terms of memory, when i declare something like:
  char arr[4];</p>
  
  <p>How many bytes are reserved for arr?</p>
  
  <p>How is null string accommodated when I 'strcpy' a string of length 4 in arr?</p>
  
  <p>I was writing a socket program, and when I tried to suffix NULL at arr[4] (i.e. the 5th memory location), I ended up replacing the values of some other variables of the program (overflow) and got into a big time mess.</p>
  
  <p>Any descriptions of how compilers (gcc is what I used) manage memory?</p>