1#include <stdio.h>2 #defineDebug 03 intMain ()4 {5 inta[3][4]={{8,2,6,4},{1,4,7,9}},i,j;6 #ifDebug7a++;8a[0]++;9a[1]++;Tena[2]++; Onea[3]++; A #endif -printf"a:%p a+1:%p\n\n", a,a+1);//16 bytes Difference - theprintf"a[0]:%p a[0]+1:%p &a[0][1]=%p\n", a[0],a[0]+1, &a[0][1]); -printf"a[1]:%p a[1]+1:%p &a[1][1]=%p\n", a[1],a[1]+1, &a[1][1]); -printf"a[2]:%p a[2]+1:%p &a[2][1]=%p\n", a[2],a[2]+1, &a[2][1]); -printf"a[3]:%p a[3]+1:%p &a[3][1]=%p\n", a[3],a[3]+1, &a[3][1]); + return 0; -}//a[0], a[1],a[2],a[3] is a one-dimensional array name that represents the starting address of a one-dimensional array, which is the address constant + //A+1 and a have an address difference of 16 bytes, which is equivalent to four elements, a represents the address of the first row, and a+1 represents the address of the second row. A /*a[0]+1 and A[0] have a 4-byte address difference, which is equivalent to 1 array elements. So a[0]+1 equivalent to the address of element A[0][1] at A[1]+1=&a[1][1],a[2]+1=&a[2][1]*/
Deep understanding of two-dimensional arrays