Tomás Ó hÉilidhe <toe@[EMAIL PROTECTED]
> writes:
[...]
> A memory address is a very concrete thing. It's basically a number. It
> could 1756, or 345, or 6852.
[...]
That's one way to look at it, and it matches the way pointers are
implemented on most systems.
Personally, I prefer to think of pointers (or, equivalently,
addresses) as something a bit more abstract. A pointer value is
something that refers to an object. If the object is an element of an
array, you can perform arithmetic on the pointer value to obtain a
pointer that refers to a different element of the same array. In C,
every pointer value / address has a type associated with it, which
indicates what type of object it can point to.
Pointer values are commonly implemented as numeric machine-level
addresses (usually virtual memory addresses), but that's usually not
the best way to think of them. An address could just as easily be
implemented as a pair of numbers denoting a segment and an offset
within that segment, or as something even more exotic.
--
Keith Thompson (The_Other_Keith) <kst-u@[EMAIL PROTECTED]
>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"


|