|
|
|
|
|
by ChrisSD
2485 days ago
|
|
> As I have said previously, memory is like a huge array with (say) 0xffffffff elements. A pointer in C is an index to this array. Thus when a C pointer is 0xefffe034, it points to the 0xefffe035th element in the memory array (memory being indexed starting with zero). I'm not sure how true this is outside of a particular platform/compiler. As far as I'm aware, C doesn't actually define how pointers are represented, only that they are a reference to memory (although null is a special case). Pointers in C are very abstract which allows for much more aggressive optimisations. And all this is before we get into how memory actually works in practice, such as CPU cache lines. |
|
[1]: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2263.htm#q3...
[2]: https://blog.regehr.org/archives/1621