![]() |
![]() |
![]() |
![]() |
![]() |
|
Accordingly, if you want to have the pointer variable, iptr, point
to the memory allocated for the ordinary variable, i, you can write
the following assignment statement:
iptr = &i;
The result, viewed from the memory perspective, is that 88, the
address of i, is deposited in the chunk of memory reserved for the
pointer, iptr:
iptr
----*--------*--------*--
|00000000|01011000| <----------------------*
---*--------*--------*----- |
24 25 26 27 |
|
i |
----*--------*--------*--------*--------*-- |
|00000000|00000000|00000111|10010111| |
---*--------*--------*--------*--------*----- |
88 89 90 91 |
| |
*------------------------------------------*