Skip to content

Pointers. Parents of web links

Memory Representation Pointer
Memory Representation with Pointer

You're in troubles visiting an unknown city, having just discovered how unclear your map is.
Ask somebody the direction from where you're now, the Y position, to your X destination.
That's what you basically need.
More paths exist between Y and X, which can be fast but ugly, or long but panoramic: generally the way you reach X is not so important... and this is of worth for us too in our talk.
Indeed you only want to sign X and Y on your map.

Are you recognizing the web links surface behavior?
By starting from a web site you go to another one with a click, completely ignoring the path.
Classical example: from search engine results to a possible point of interest.

Yes, the point: you point your attention to it; the amount of solutions to get it is classifiable as pointer.

By talking about variables we said that the name chosen for them is a label to mask the address assigned to them in memory.

Pointers are variables pointing to other variables (even pointers again).
Picture above shows this: VAR Y is the var that actually masks the address 6 in memory, while VAR X the 1.
Simply VAR Y location contains VAR X value, but knowing how to threat it: value 6 is not an integer, but an address.
This means it can be only used to reach another memory location.

A possible scheme is: VAR Y ---> VAR X = 10 (integer).

We know VAR Y is a pointer, a variable which by nature must be characterized by the type of data it contains.
So a pointer is generally declared as a pointer to x-type.