Suppose we have these local variables:
int a = 0;
int b = 1;
int c = 2;
int d = 3;
As far as I know, they will be allocated in the system stack, for example:
| |
| 3 | d
| 2 | c
| 1 | b
|_0_| a
Does this mean that to get the value of a, the values โโof d, c and b must be popped from the stack? If so, where do these values โโgo? Does this mean that access to later declared variables will be faster? Or am I missing something (which, I suspect, is), and does it all work in some other way?
EDIT: thanks guys!
source
share