title: C Char pointers
body: <p>Let us say we have a array of pointers:</p>
  
  <p><code>char *ptr[30];</code></p>
  
  <p>Now this works fine, and doesn't seems to do anything unexpected!
  I can input names easily.</p>
  
  <pre><code>scanf("%s", ptr[1]);
  scanf("%s", ptr[2]);
  scanf("%s", ptr[3]);
  
  printf("%s\n", ptr[1]);
  printf("%s\n", ptr[2]);
  printf("%s\n", ptr[3]);
  </code></pre>
  
  <p>My question is if a pointer can be used in this way to store end number of names, then why is malloc used.? and in this case ptr[1] does not point to the character in the input but to a new input itself.
  for eg if ptr has mukul, ptr[1] should point to 'u'
  and if space is not allocated when a pointer is declared like this, what are the limits.?</p>