title: When does a pointer in C figure out the amount of memory it references?
body: <p>I've been learning about linked lists and the recursive definition of the node struct has been bugging me</p>
  
  <pre><code>struct node {
      struct node *next;
      int data;
  };
  </code></pre>
  
  <p>I guess I've always imagined that since a pointer is typed, it knows both the beginning address and the amount of memory it can access when it's dereferenced, at the time of declaration. But it can't possibly, since it's declared before an arbitrary amount of other variables which can make the struct of any size. Does it figure it out only when dereferenced, or is there some sort of memory table that gets filled at the end of the struct definition and before the pointer could be used?</p>