3 ms·
I don't understand. Pointers aren't numbers, and can only be compared when inside a common array. What is small number memory? :-)
by lupire 2y ago
I don't understand. Pointers aren't numbers, and can only be compared when inside a common array. What is small number memory?
:-)
- MobiusHorizons 2y agoI realize you are probably referring to UB in c/c++, but of course in hardware memory addresses are numbers. And when debugging, it’s really the hardware version of events that matters, since the compiler has already done whatever optimizations it wants.
- ryao 2y agoPointers are numbers representing memory addresses. This is very obvious if you look at the definition of NULL in C. It is: #define NULL ((void *)0) As of C99, C also has uintptr_t, which lets you treat pointers as integers.
- moomin 2y agoI mean, that’s horribly misleading. There’s no guarantee that “zero” is actually an int zero. (Although I’m pretty sure it is on Intel and ARM.)