title: Size of dynamic array in C doesn't change
body: <p>I was getting <code>realloc(): invalid next size</code> for a program. So I just coded this to understand what's happening.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  int main()
  {
      char *inp;
      printf("%lu ",sizeof(inp));
      char *res = (char*)malloc(15*sizeof(char*));
      printf("%lu ",sizeof(res));
      res = "hello world";
      printf("%lu\n",sizeof(res));
      return 0;
  }
  </code></pre>
  
  <p>And surprisingly it outputs <code>8 8 8</code>. Can anyone explain why is it like that? Why is it 8 by default? And how <code>malloc()</code> effects size of <code>inp</code>?</p>