lycium Wrote:
-------------------------------------------------------
<snipped>
> besides this there is only the syntactic
> difference between references and pointers...
>
No, there is not. A pointer is a variable that
can hold an address to memory. A
reference is the address of an object in memory. Hence, a pointer can have arithmetic
performed on it, and can point to nothing at all, while a reference cannot support
arithmetic operations and always has to be valid (cannot have a reference to "nothing",
like a pointer to "NULL" or a reference to anything, like a pointer to "void"
.
The only similarity I can see is that taking the address of a variable results in both a
pointer and a reference, whichever you would like.