3 ms·
> A pointer stores a number I disagree with this, and I think it's important to understanding pointers. A pointer is a number. A variable stores a value.[1] A
by msla 6y ago
> A pointer stores a number
I disagree with this, and I think it's important to understanding pointers.
A pointer is a number. A variable stores a value.[1] A variable has an address, a value does not; a value might be stored at an address, but it doesn't intrinsically have an address. A person might live in a building, but the building has the address, not the person, who can move.
[1] (In C-like languages this is true. In Python, a variable stores something you're largely not allowed to inspect, which might be a pointer to a data structure with data and metadata. Haskell has no variables, just names for constants.)
- scoutt 6y agoIf I put you in front of a wall full of numbers, and I tell you "point a number with your finger and remember it", what is your finger? A number? Or the thing you use to point a number?