title: Are member variables of an object that is on the heap also automatically on the heap?
body: <pre><code>class A
  {
  public:
    A();
    ~A();
    int X;
  };
  
  A::A()
  {
    X = 5;
    int Y = 4;
  }
  
  //..... in another file
  A * objectOnHeap = new A();
  </code></pre>
  
  <p>In this case, since "objectOnHeap" is on the heap, is X also on the heap even though it wasn't specifically new'd up?  And in this case Y is allocated on the stack (and of course goes out of scope), correct?</p>
  
  <p>I am wondering if I have gotten my wires crossed when trying to envision how objects are stored in memory.</p>