-1
$\begingroup$

I was asked this question in examination. A square matrix $M$ of size $10 \times 10$ is stored in memory with each element requiring 4 bytes of storage. If the base address at $M[0][0]$ is $1840$, determine the address at $M[4][8]$ when the matrix $M$ is stored row majorwise. I seriously don't understand this question at all. What kind of problem is this? How to solve these kind of problems?

$\endgroup$
1
  • 1
    $\begingroup$ This is elementary school mathematics. Just do the numbers. And, to say the usual: what have you tried? Where did you get stuck? (Did you have a look at the course material?) I'm closing this for now since it's unclear what your real problem is and the answer is readily found on Wikipedia. $\endgroup$ – Raphael Jan 7 '14 at 13:05
1
$\begingroup$

Is this a homework question? What is the point you exactly don't get? M[0][0] is a memory location stored at some address like 0x5468792. M[4][8] is another one like 0x5478954 (numbers are not correct). The question asks you to compute the address in a multi-dimensional array, given the first pointer.

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.