|
|
Pointers, Cont. |
|
int i = 1;
int *ptr;
ptr = &i;
printf ( "The value of i is %d and the address of i is 0x%x\n", i,
(unsigned int) ptr );
ptr and i now reference the same value
then ptr may be dereferenced to produce the value
printf ( "The value of i is %d and the address of i is 0x%x\n", *ptr,
(unsigned int) &i );
NULL and many functions will
do this as a return value.