How are c++ class objects stored in memory?

For example when I have:

Class A{
B objectB;
};

Now when I instantiate the object of class A like:
main(){
A objectA;//option 1
A* pObjectA = new A();// option2
}
How is objectB stored in memory (stack heap etc.) for both options??

Thanks!!
Topic archived. No new replies allowed.