I understand that arrays in C are allocated in row-major order. Therefore, for a 2 x 3 array:
0 1
2 3
4 5
Is stored in memory as
0 1 2 3 4 5
However, what if I have a 2 x 3 x 2 array:
0 1
2 3
4 5
and
6 7
8 9
10 11
How are these stored in memory? Is just consecutive like:
0 1 2 3 4 5 6 7 8 9 10 11
Or is it some other way? Or does it depend on something?
question from:https://stackoverflow.com/questions/5920944/how-are-3d-arrays-stored-in-c