My understanding of pointers

My understanding of pointers is that they allow the memory cell location to be known. They also allow one to access the variable’s value by dereferencing using (*).

My_variable = 24;
Pointer = &My_variable; //assuming the cell location is 2200. ‘Pointer’ now holds the value 2200 which is the location of the cell in the computer’s memory

dereferencing operator (*) being used to access the value of My_variable from Pointer:

Access_value = *Pointer;
Acess_value now equals 24

Acess_value = Pointer;
Access_value now equals 2200.

I hope that makes sense.

Privacy & Terms