----------------解决方案--------------------------------------------------------
[CODE]
#include<stdio.h>
struct stu{
int num;
char name[20];
}student[3]={{1,"yqiong"},{2,"song"},{3,"li"}},*p;
int main()
{
p=(struct stu*)student[0].name;
printf("%d\n",p);
p=p+1;
printf("%d\n",p);
printf("%d\n",p->num);
printf("%d\n",&student[0]);
printf("%d\n",&student[0].name);
return 0;
}
[/CODE]
楼主调试一下,就清楚了
----------------解决方案--------------------------------------------------------
#include "stdio.h"
#include "conio.h"
main()
{
char *p;
int *q;
printf("%d\n",sizeof(*p));
printf("%d\n",sizeof(*q));
p=(char*)q;
printf("%d\n",sizeof(*p));
getch();
}
有警告,看看结果就行.
----------------解决方案--------------------------------------------------------
恩,明白了,谢谢
----------------解决方案--------------------------------------------------------