
Arrays, Decay and Row-Major Addresses
Array to pointer decay and its three exceptions, the identities a[i] = *(a + i) = i[a], partial initialisation, a versus &a versus &a[0], sizeof of arrays and of array parameters, two-dimensional arrays as arrays of rows with types and strides, row-major and column-major address formulas with lower bounds and computed examples, passing a 2-D array to a function, and the solved GATE CS 2019 Q.24.
![int a[3][4] drawn as a 3 by 4 grid of byte offsets 0 to 44, with a[1][2] at offset 24 highlighted, and the same array as one strip of three 16-byte rows with markers a at 0, a+1 at 16, a+2 at 32 and &a+1 at 48.](https://bywjbbkinjqiyalvzqfd.supabase.co/storage/v1/object/public/sheet-media/PCC/PCC-15/diagrams/PCC-15.d01.webp)

![Three ways to hold the string GATE: char s[10] holds G A T E and six null bytes; char t[] holds G A T E and one null byte; const char *p is a pointer cell whose arrow leads to the 5-byte literal, which must not be modified.](https://bywjbbkinjqiyalvzqfd.supabase.co/storage/v1/object/public/sheet-media/PCC/PCC-16/diagrams/PCC-16.d01.webp)