, "N-element array of T" , " T", . , sizeof, & (), , .
:
int a[10] = {0};
printf("a = %p, &a = %p\n", (void *) a, (void *) &a);
printf a , "10- int" " int" , (&a[0]). &a " 10- int", , a ( ).
undefined , r , , , , . :
int a[10] = {0};
int (*r)[10] = &a;
printf("r = %p, *r = %p\n", (void *) r, (void *) *r);
r == &a *r == a.
The expression ris of type "pointer to a 10-element array int", and its value is an address a. The expression *ris of the type "10-element array int, which is converted to a" pointer to int", and its value is set to the address of the first element, which in this case is equal a[0]Again, the values of the two expressions are the same.
source
share