I am having a little confusion about memory allocation. Where does member variable get created (on stack or heap?) when object is created on heap? For example, say we have class Cat as follows.
class Cat { public: int itsage;};
Now suppose we have following line of code in main function.
Cat * Frisky= new Cat;
Now I guess here pointer variable Frisky is created on stack which stores memory address of memory on heap(Am I right?). But I am confused where is integer variable itsage is created? Also what will happen if itsage was itself pointer? i.e.
int * itsage;
Thanks.