When we instantiate a variable in C++, such as int x within a function (i.e. x is a local variable), it is allocated on the process's stack.
However, if we do int *x= new int, heap space is granted. So here are my inquiries:
What about objects of multiple classes (c++ classes or user specified classes)?
Where are their items created?
As an example:
Employee is a class, and we declare it emp;.
Is emp allocated space on the stack or on the heap?
Do all four cells of a get stack space if the declaration int a[4] is within a function?