Memory in a Computer
Memory in a computer is just a sequential set of "buckets" that can contain numbers, characters, or boolean values. By using several buckets in a row, we get arrays. By giving names to a set of contiguous buckets, we get a "structure." But at its core, a computer memory is a very simple list of numbers. Everything else must be built up upon this.
Memory Layout
Memory is laid out in sequential order, basically from 0 on up (one byte at a time). Each position in memory has a number (called its address!).
The compiler (or interpreter) associates your variable names with memory addresses.
In some languages like C, you can actually ask the computer for the address of a variable in memory. In C this is done using the ampersand. &
In many languages, the actual address is hidden from you and is of little use to you, as all the access methods "abstract" the details of the computer hardware away, allowing the programmer to concentrate on the algorithm and not the details.
Array variables simply contain the address of the first element of the array. Arrays are zero-based, so the address simply becomes the base address plus the index.
Structure variables simply contain the address of the first element of the structure, and each "named" field of the structure forms an offset from the first bucket. The computer keeps track of this offset so that the programmer can use symbolic names instead of numbers.