int a[]={10,20,30,40};
short *p,*q;
p=(short*)(a+1);
q=(short*)a;
a[p-q]=?
---------
假设a地址为X, a+1 = X+4, 赋值给p
q指向a的首地址X
p,q之间相差四个字节,即p-q为2个short长
所以a[p-q]-> a[2]
short *p,*q;
p=(short*)(a+1);
q=(short*)a;
a[p-q]=?
---------
假设a地址为X, a+1 = X+4, 赋值给p
q指向a的首地址X
p,q之间相差四个字节,即p-q为2个short长
所以a[p-q]-> a[2]