Here is a chart.
& p = 0xcafebabe p = 0xfeedbeef * p = 0xdeadbeef <- memory address
+ -------------- + + --------------- + + ---------------- +
| p = 0xfeedbeef | -> | * p = 0xdeadbeef | -> | ** p = 0x01234567 | <- memory contents
+ -------------- + + --------------- + + ---------------- +
So &p is the address of p , which is 0xcafebabe . In the 0xcafebabe memory 0xcafebabe , the value p, p , which is equal to 0xfeedbeef , is 0xfeedbeef . This is also the address *p .
So repeat after me: the p value is the address *p .
And the value of &p is the address of p .
And the value *p is the address **p .
And so on and so forth. So * and & are similar to opposites and *&p == p == &*p if you are not doing funny things with operator overloading.
source share