0

It boggles me that "&p" isn't the same as "&var"

int var = 50; int *p; p = &var;. Basically, the data stored in pointer p is var's memory location, although the memory location of p is some other coordinates.

21st Oct 2019, 1:04 PM
Eric Desjardins
Eric Desjardins - avatar
2 Answers
+ 4
Here's visualization of your example: https://code.sololearn.com/cI3lheys34IY/?ref=app
21st Oct 2019, 1:57 PM
voja
voja - avatar
+ 3
Does it become easier if you just regard an adress as a data type? int x; // can store an int int *x; // can store an address to an int
21st Oct 2019, 1:29 PM
HonFu
HonFu - avatar