In C++, a variable like int x (which is a local variable because it is instantiated within a function) is allocated on top of the process stack.
However, if we use int *x=new int, heap space is made available.
So here are my inquiries:
So here are my inquiries:
1. What about objects belonging to several classes (user-defined or classes given by C++)?
Where do their things actually get created?
For instance:
Employee shall be a class, and Employee shall be declared emp;.
Empty spaces are either supplied on a stack or in a heap.
2.Do all four of the cells in int a[4] of a receive stack space if the declaration is contained within a function?