Can't be answered without knowing what it's an array of, and what size that datum is in memory on your machine's architecture, and what your machine's alignment rules are.

Once you know those, you should be able to figure out how the data are arranged in memory for one array, and (big hint) how one-dimensional and two-dimensional arrays are related. It may help to remember that array math and pointer math are fairly interchangable -- if a is an array, *(a+1) accesses the same location as a[1].

If that doesn't help you solve the problem, go back and reread your course notes. This is stuff you really do need to understand well if you're going to work in C, and handing you the answer won't help you learn it.

## Comments

9 years ago

Homework assignment, I take it.

Can't be answered without knowing what it's an array of, and what size that datum is in memory on your machine's architecture, and what your machine's alignment rules are.

Once you know those, you should be able to figure out how the data are arranged in memory for one array, and (big hint) how one-dimensional and two-dimensional arrays are related. It may help to remember that array math and pointer math are fairly interchangable -- if a is an array, *(a+1) accesses the same location as a[1].

If that doesn't help you solve the problem, go back and reread your course notes. This is stuff you really do need to understand well if you're going to work in C, and handing you the answer won't help you learn it.

Answer 9 years ago

worst case scenario -- build the array, fill it with unique values, then actually read the memory dump.

Answer 9 years ago

+1