//指针运算
#include <stdio.h>
int main()
{
int a[5] = {1,2,3,4,5};
int* p1 = (int*)(&a + 1);
int* p2 = (int*)((int)a + 1);
int* p3 = (int*)(a + 1);
printf("%d, %d, %d \n",p1[-1],p2[0],p3[1]);//5 33554432 3
return 0;
}
指针与数组
最新推荐文章于 2024-01-18 00:15:00 发布