看板 TransCSI 關於我們 聯絡資訊
A 10*10 array A is stored in main memory using row-major arrangement. Its starting address (address of A[0][0]) is 300, and the address of A[1][2] is 324. what is the address of the array element A[2][3]? 答案是347  可是我怎麼算都是351  到底錯在那裡阿  希望會的大大們 幫我解答 thx -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 114.47.8.133
avogau:怎麼看起來像346 03/05 21:02
andy74139:令此陣列每個元素為x bytes. 則 300+10*1*x+2*x = 324 03/05 21:17
andy74139:故x=2, A[2][3]的位置為 300 + 10*2*x + 3*x = 346 03/05 21:18
x43758697000:嗯 謝謝andy大 我知道怎麼算了 應該是346拉 03/06 09:10
stator:嗯~我也是算346 03/07 18:13