title: size of a node in linked list
body: <p><strong>Program:</strong></p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;stdlib.h&gt;
  using namespace std;
  struct node 
  {
      int data;
      struct node *next;
  };
  
  int main() 
  {
      struct node* head = NULL;
      head = (struct node*)malloc(sizeof(struct node)); 
      cout&lt;&lt;sizeof(struct node)&lt;&lt;"\n"&lt;&lt;sizeof(head)&lt;&lt;"\n"&lt;&lt;sizeof(int);
      return 0;
  }
  </code></pre>
  
  <p><strong>Output:</strong></p>
  
  <pre><code>8
  4
  4
  </code></pre>
  
  <ol>
  <li>Why is <code>sizeof(struct node)</code> different than <code>sizeof(head)</code> ?
  Wouldn't have malloc allocated 8 bytes ? </li>
  <li>Since <code>sizeof(head)</code> is
  same as <code>sizeof(int)</code> , where is <code>next</code> stored then ?</li>
  </ol>