3 ms·
A pointer doesn't necessarily have an address - think of the semantics of the register storage class ;) Or perhaps more commonly in C, when a pointer to a vari
by KaeseEs 15y ago
A pointer doesn't necessarily have an address - think of the semantics of the register storage class ;) Or perhaps more commonly in C, when a pointer to a variable is passed by value as an argument to a function in a register.
Of course, trying to take the address of a variable declared to be in the register storage class is an error, and taking the address of a variable in the normal automatic storage class typically forces it to live on the stack.
- sirclueless 15y agoPointers have an address, in the sense that it is semantically correct to take their address. If they happen to reside in a register at a given moment, that is an optimization and doesn't change their semantics.