# Friday, June 05, 2009
Usually the explanation of object reference or pointer goes it is an address which reference something. Well in high level overview we can simplify this to that explanation, but today we well look the difference between the object reference and pointer and we well see why reference in not nearly the same thing as pointer.

Address
First we will look what the address is. Every data cell in memory have address, as every person have home address, basically that simple it is. Address just happen to be a property of some specific memory implementation, we could just have other way to access it.

Reference
Reference is really simple programming concept. It just reference to something. You have NO control over it. You can just reference and dereference it.

Pointer
Pointer is an abstract programming concept, which points somewhere and supports arithmetic operations. Strictly looking, pointer "per se" have no information, it just know where can find it. And you have control over it (arithmetic operations). What is connection between pointer and address? Well Pointer is not an address. Pointer is just implemented with address, because it just perfectly suits to what Pointer needs. To summarize, Pointer can do everything what can Reference plus more.

To better understanding I have made some simple diagrams, how looks those two concept in .NET:



posted on Friday, June 05, 2009 1:29:52 PM (Central European Daylight Time, UTC+02:00)  #    Comments [0] Trackback