-3

有人可以解释这些答案吗?2. , 4. 能看懂,其他的看不懂

int a[ ] ={2,4,3,1,10,5,9,6,8,7};
int *pa = &a[4],*pb = &a[1];

What is the value of the below?
1.*(a + 3)
2.*pb-*pa
3.pb[3]
4.*pa + 5
5.*(pa-2)
6.pa[4] 


Answer:

1.*(a + 3)=1
2.*pb-*pa=-6
3.pb[3]=10
4.*pa + 5=15
5.*(pa-2)=3
6.pa[4]=8
4

1 回答 1

1

x[y]等价于y[x],即等价于*(x+y)or *(y+x)。所以*(a+3)等价于a[3]or 3[a]

于 2013-06-26T03:23:03.303 回答