title: In C++, can a class include a pointer to the same class that's initialized in the constructor?
body: <p>I know a class can't have a member of the same class, e.g. </p>
  
  <pre><code>class Sample {
      int a = 0;
      Sample s; // error, object would need infinite size
  };
  </code></pre>
  
  <p>But how come having a pointer is okay?</p>
  
  <pre><code>class Sample {
      // this compiles, but isn't it essentially the same
      // as above? 
      Sample() { s = new Sample(); } 
      int a = 0;
      Sample *s; 
  };
  </code></pre>