4 ms·
> A pointer is literally a stored memory address, i.e. an integer You’re mixing implementation with definition. A pointer is (usually) implemented in terms of
by klmr 8y ago
> A pointer is literally a stored memory address, i.e. an integer
You’re mixing implementation with definition. A pointer is (usually) implemented in terms of an integer (i.e. its physical representation is a sequence of bytes interpreted as an integer offset in memory). But that isn’t what a pointer is. The C++ standard (or the C standard, or Rust, or any of many other languages) defines pointers as a concept that has all kinds of properties that integers don’t have. The whole point of this blog post is that this distinction is crucial in order to guarantee type safety and allow the compiler to perform basic optimisations.