Consider a generic expression myvar which is not yet initialized to any value. If we want to create a reference (pointer) to myvar, we can simply set:
pointToMyvar = myvar;
Now if we go ahead and initialize myvar to some value:
myvar = 5;
we see that our pointer properly accesses the correct memory location to retrieve the value:
pointToMyvar
5
And, of course after myvar is changed again
myvar = 7;
the pointer knows about it
pointToMyvar
7
However, now that myvar is initialized, it seems that we cannot create any further pointers to it. If we now try
pointToMyvarAgain = myvar;
and change myvar yet again
myvar = 10;
we see that the new reference does not actually refer to myvar but rather just to the integer that was stored in myvar at the moment of assignment:
pointToMyvarAgain
7
Therefore, I would like to know if there is any way how I could define a pointer to myvar (same as pointToMyvar above), after myvar has been initialized to some explicit value? Thanks for any suggestion!
pointToMyvar := myvarmeet your needs? – bbgodfrey Feb 12 '17 at 06:59