I understand that objects initialized with 'new' are allocated from the heap, but what about their members? For example, I have class A:
class A
{
private: int a; //here "a" should be on stack
};
Then I have object A defined in following code respectively
A a;
A *ap = new A();
Now the first statement places a
on stack and ap
will be in the heap, but how about a.a
and ap->a
? Are they with their parent objects?