A pointer is a variable that holds a memory address.
Your business card is a pointer, it tells me your address. Knowing that doesn’t tell me who’s in your house, I just know where to look if I want to know who’s there. Deferencing is like taking my knowledge of your address and using to drive to your house, go inside, and see who’s there.
A reference is basically an always dereferenced pointer. You’re always looking through the reference at the value of the referenced variable.
Latest Answers