I know when i create an object like that : ( say that we have an class called A )
here i have created an pointer that points to the object A.
okay i understand this way that first the hand right side is allocated first and the object is allocated in the heap then the pointer points to that object ...
Now my question is here :
i know that object is created in the heap right ? okay where's the pointer to access that object ? why we just created A obj
i just want to know how this line works in the memory like i explained the pointer how it allocated ...
Code:
A *ptr = new A();
okay i understand this way that first the hand right side is allocated first and the object is allocated in the heap then the pointer points to that object ...
Now my question is here :
Code:
A obj;
i just want to know how this line works in the memory like i explained the pointer how it allocated ...