5.87 · exercise

Basic quiz: arrays and structures

How arrays and structures are laid out in memory, and how AArch64 code computes the address of a single element or field.

0 of 5 correct

Multiple choice

A function declares a local array of ten int values. Where does that array live while the function is running?

Multiple choice

For a one-dimensional array, what is the address of element i?

Multiple choice

How does C map a two-dimensional array onto the flat bytes of memory?

Multiple choice

How does assembly code reach an individual field inside a structure?

Multiple choice

On 64-bit Linux, an array of long values starts at the address in arr. Which expression gives the address of arr[2]?