What is the formula to calculate address in multi dimensional array ?
Let us consider your array be A[x][y][z] starting with 0 indices. We have to find address of A[p][q][r] : A[p][q][r] = ( (p*y + q) *z + r) * size + base . if you have array not starting with 0 index . lets say A[x1:x2][y1:y2][z1:z2] then A[p][q][r] = (((p-x1)*(y2-y1+1) +(q-y1))*(z2-z1+1) +(r-z1)) * size + base.