title: Why do linked lists use pointers instead of storing nodes inside of nodes
body: <p>I've worked with linked lists before extensively in Java, but I'm very new to C++. I was using this node class that was given to me in a project just fine</p>
  
  <pre><code>class Node
  {
    public:
     Node(int data);
  
     int m_data;
     Node *m_next;
  };
  </code></pre>
  
  <p>but I had one question that wasn't answered very well. Why is it necessary to use</p>
  
  <pre><code>Node *m_next;
  </code></pre>
  
  <p>to point to the next node in the list instead of</p>
  
  <pre><code>Node m_next;
  </code></pre>
  
  <p>I understand that it is better to use the pointer version; I'm not going to argue facts, but I don't know why it's better. I got a not so clear answer about how the pointer is better for memory allocation, and I was wondering if anyone here could help me understand that better.</p>