If you have a line of code like
int num = 4;
Does this result in the following tables?
VARIABLE|ADDRESS ADDRESS|VALUE
num |0001 0001 |4
If you were to then say
int* num_p = #
Would this result in the following tables?
VARIABLE|ADDRESS ADDRESS|VALUE
num |0001 0001 |4
num_p |0002 0002 |0001
Would then saying
int** num_pp = &num_p;
Result in the following tables?
VARIABLE|ADDRESS ADDRESS|VALUE
num |0001 0001 |4
num_p |0002 0002 |0001
num_pp |0003 0003 |0002
And so on? If so, would this same logic hold true if the initial variable were not an int
but instead a struct
?
EDIT: Check the comments on this question for info on what the addresses would actually look like as opposed to this made up 0001
, 0002
, 0003
scheme.
EDIT 2: This answer to this question points out the fact that variables do not necessarily have to have an address. This answer to an earlier question also goes into this.