A: Represents a two-dimensional array name, pointing to a one-dimensional array a[0], that is, 0 header address;
a[0],* (a+0), *a: represents 0 Rows 0 column element address;
a+1,& (a+1): 1 header Address
a[1]+2,* (a+1) +2,&a[1][2]:1 row 2 column element a[1][2] Address
* (a[1]+2,* (* (a+1) +2), a[1][2]:1 row 2 column element a[1][2] Value
A two-dimensional array name is a pointer to a row;
For example, a and a+1 are pointers to rows, in front of which are *a and * (a+1), they are pointers to columns, respectively, to the elements of array 0 row 0 columns, and 1 rows and 0 columns, and vice versa, by adding & to the pointer to the column, which is a pointer to the row;
&a[i] or a+i points to the row, A[i] or * (a+i) to the column, when the column is labeled 0 o'clock, &a[i] and A[i] (that is, a[i]+j) values are equal, that is, the same address value, but the object is different, the pointer type is different;
In a two-dimensional array, the values of A+i, A[i], * (A+i), &a[i], and &a[i][0] are equal and are the same address values;
Example:
#include <studio.h>
#define FORMAT "%d,%d\n"
void int main ()
{
int a[3][4]={1,3,5,7,9,11,13,15,17,19,21,23};
printf (format,a,*a);
printf (format,&a[0],&a[0][0]);
printf (format,a[1],a+1);
printf (format,&a[1][0],* (a+1) +0);
printf (format,a[2],* (a+2));
printf (format,&a[2],a+2);
printf (format,a[1][0],* (* (a+1) +0));
return 0;
}
multidimensional arrays and pointers {notes}