English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

A 2D array is declared as A[9,7] and column wise each element requires 8 byte. If A[ 1,1 ] is stored in 1200. Find the memory of A[8,5] ?

provide me with clear steps plz... important..

2006-10-10 18:16:59 · 4 answers · asked by Anonymous in Science & Mathematics Mathematics

4 answers

there are total of 9*7=63 elements present. Array starrts with a[0,0]. 9th element is at 1200.In between 9th and 40th(8*5) there are 30 elements taking 240 bytes.if u are not using hex format the answer is 1440(1200+240). But if u are using hex calculation convert 240 to hex and then add it. I dont understand wen u say column wise each element require 8 byte

2006-10-10 18:32:15 · answer #1 · answered by Bunty Rocks 2 · 0 0

Your question is very hard to understand. I'm assuming that the array is 9 columns by 7 rows and starts at memory location 1200 bytes (and I'm assuming 1200 is a decimal number). I'm also assuming that the columns are stored linearly, one column right after the other.

In this case, A[8,5] would be 7 full columns and 5 rows after A[1,1]. 7 full columns each have 7 rows, so that's 49 cells. Add the 5 cells and you have 54 cells. Each cell occupies 8 bytes, so A[8,5] is 54*8 bytes after A[1,1], or 432 bytes. Since A[1,1] starts at 1200 bytes (I'm assuming!) then A[8,5] is at 1200+432, or 1632.

2006-10-11 01:32:57 · answer #2 · answered by i_sivan 2 · 0 0

So how many elements separate the two locations? Multiply by the number of bytes per element.

2006-10-11 01:33:23 · answer #3 · answered by arbiter007 6 · 0 0

depends if the array is zero based or 1 based.

2006-10-11 01:57:19 · answer #4 · answered by gjmb1960 7 · 0 0

fedest.com, questions and answers