Olumide said:
That's the question.
I know about virtual memory, and the MMU.
I just wonder if array members guaranteed to be contiguous
in physical memory (and if so, why).
The ANSI/ISO C standards don't specify
how physical or virtual memory is organized
but they do use the notion of a sequence of addresses
in increments of bytes (the size of a char).
Yes, the elements of an array are guaranteed
to be contiguous in this address space
but, if you understand VM and the MMU,
you know that the physical location
in the machine physical address space
may actually be quite different.
In the typical implementation,
the address space specified by the C programming language
maps neatly onto the virtual memory space
so you are not led too far astray
if you take them to be equivalent.