I know how pointers work for a 1D and 2D array, but I'm trying to figure it out for a 3D array.
For a 1D array:
V[i] ==> *(V+i)
for a 2D array with C columns
M[i][j] ==> *(M+(C*i+j))
What would be the pointer arithmetic for a 3D array?
M[i][j] ==> *(M+(C*i+j))
wrong. It is
M[i][j] ==> *(*(M+i)+j)
for 3D
M[i][j][k] ==> *(*(*(M+i)+j)+k)