![]() |
![]() |
![]() |
![]() |
![]() |
|
Recall that you can use the address-of operator on array locations. For
example, suppose that number is the name of an integer array whose
first element resides at memory location 88:
0 1 2 <-- Array
| | | index
v v v
--------------- --------------- --------------- -----------
--*---*---*---*---*---*---*---*---*---*---*---*---*---*---*-
| | | | | | | | | | | | | | |
-*---*---*---*---*---*---*---*---*---*---*---*---*---*---*--
^ ^ ^ ^ ^ ^ ^ ^
| | | | | | | |
88 90 92 94 96 98 102 104
Then, &number[0] returns 88, the address of the
first element, and &number[1] returns 92, the
address of the second element, and so on.