70,023
社区成员




#include <stdio.h>
int
main(int argc, char *argv[])
{
int arr[2][2] = { { 1, 2 }, { 3, 4 } };
/*
C89
3.3.2.1 Array subscripting
Constraints
One of the expressions shall have type ``pointer to object type ,''
the other expression shall have integral type, and the result has type
`` type .''
Semantics
A postfix expression followed by an expression in square brackets
[] is a subscripted designation of a member of an array object. The
definition of the subscript operator [] is that E1[E2] is identical to
(*(E1+(E2))) . Because of the conversion rules that apply to the
binary + operator, if E1 is an array object (equivalently, a pointer
to the initial member of an array object) and E2 is an integer, E1[E2]
designates the E2 -th member of E1 (counting from zero).
*/
/*
*(arr + 1) 相当于 arr[1] 嘛, 是一个int [2]的数组啊
*/
printf("%d\n", (int)sizeof(arr[1]) );
printf("%d\n", (int)sizeof(*(arr + 1)) );
printf("%p\n", arr[1] );
printf("%p\n", *(arr + 1) );
return 0;
}