void main(){
struct student{
int a;
int b;
int c;
};
student s={3,5,8};
student* p=&s;
printf("%d/n",*(int *)p);
p++;
printf("%d",*p);
system("Pause");
}
(int *)p是强制地址转换,将结构体指针P的地址转换为int 型。
char p;
char buf[10]={1,2,3,4,5,6,9,8}
p=(buf+1)[5]
printf("%d",p);
p就是指向buf数组的第5+1个元素
struct student{
int a;
int b;
int c;
};
student s={3,5,8};
student* p=&s;
printf("%d/n",*(int *)p);
p++;
printf("%d",*p);
system("Pause");
}
(int *)p是强制地址转换,将结构体指针P的地址转换为int 型。
char buf[10]={1,2,3,4,5,6,9,8}
p=(buf+1)[5]
printf("%d",p);
p就是指向buf数组的第5+1个元素