假設二維陣列 B[M][N]採用以列為主的順序(row-major order)且索引值(index)由 1 開始,則元素 B[s][k]儲存於下列那一個記憶體位置?
A$B+k*N+s$
B$\mathrm{B} + (\mathrm{s - 1})^{*}\mathrm{N} + (\mathrm{k - 1})$正確答案
C$\mathrm{B} + (\mathrm{s - 1})^{*}\mathrm{M} + (\mathrm{k - 1})$
D$\mathbf{B} + \mathbf{s}^{*}\mathbf{M} + \mathbf{k}$
答案與詳解
