Suppose we have an array a[90][30][40] where first element starts from a[1][1][1] then what will be the index of a[20][20][30] in column major representation ?
According to me a[x][y][z] means x is depth, y is rows and z is columns.
So according to me, the index should be 19(30)(40) + (29)(30) + (20-1) = 23689.
I read https://eli.thegreenplace.net/2015/memory-layout-of-multi-dimensional-arrays/ which says that a[x][y][z] actually means x is rows, y is columns and z is depth.
I read all the existing answers here and also the above link and got confused.
Is my calculation correct?
a[0][0][0].int a[rows][cols][layers];, elementa[i][j][k]has an offset ofk + layers * (j + cols * i).