title: memory allocation in C, LInked List in a Heap
body: <p>I'm building a single linked list and trying to allocate memory for it like so</p>
  
  <pre><code>struct node *new_node = (node*) malloc(sizeof(node) * 5);
  </code></pre>
  
  <p>so enough memory for 5 nodes. Now accessing the first node via:</p>
  
  <pre><code>new_node-&gt;data = new_data;
  </code></pre>
  
  <p>is fine, but when I go to link another node to new_node->next, I forget how I say that the new node is a part of the memory I've already allocated. I don't want to malloc each time I want a new node as for the purposes of the assignment I'm working on, we want to malloc as infrequently as possible.</p>
  
  <p>Any clues greatly appreciated, this far I haven't been able to find what I need on the great wide webs.</p>
  
  <p>John!</p>