title: Is null character included while allocating using malloc
body: <p>I have been using C for quite sometime, and I have this trivial problem that I want to query about. </p>
  
  <p>Say i want to create a character array that stores upto 1000 characters. Now, when I am using malloc for the same, then do I specify the size of array as 1001 character [ 1000 characters + null]  or just 1000?</p>
  
  <p>Also, say I came across this problem, then how could I have found the answer to this solution on my own, maybe by using some test programs. I understand the size of string is calculated without the null character, but when I am allocating the memory for the same, do I take into account the null character too?</p>