本帖最后由 1871037345 于 2016-6-5 09:24 编辑
int a[]={1,2,3,4,5}; int *p=(int*)(&a+1);
printf("*(a+1) = %d,*(p-1) = %d\n",*(a+1),*(p-1));
printf("&a+1 = %p\n",&a+1);
printf("p = %p\n",p);
printf("&a = %p\n",&a);
printf("p-1 = %p\n",p-1);
printf("&a[4] = %p\n",&a[4]);
printf("*((p-1) - a[0]) = %d\n",*((p-1) - a[0]));
自己测试一下吧,实在不明白就把数组的存储再看一遍,尽量自己找答案
|