One-dimensional access to a multidimensional array: is it well-defined behaviour?

All arrays (including multidimensional ones) are padding-free. Even if it’s never explicitly mentioned, it can be inferred from sizeof rules. Now, array subscription is a special case of pointer arithmetics, and C99 section 6.5.6, ยง8 states clearly that behaviour is only defined if the pointer operand and the resulting pointer lie in the same array … Read more