主题:请指教!
struct student
{
int num;
float score;
};
void main()
{
struct student a,*p,*q;
a.num=10101;
a.score=95;
printf("%5.2f\n",a.score);
q=(struct student *) (& a.score);//把a.score(float)地址强制转换成struct student
printf("%5.2f\n",(q->score)); 为什么输出结果却不对,请各位帮忙指点下,谢谢!
printf("%d,%d\n",p,q);
}
[em2][em3][em3][em3][em3]
{
int num;
float score;
};
void main()
{
struct student a,*p,*q;
a.num=10101;
a.score=95;
printf("%5.2f\n",a.score);
q=(struct student *) (& a.score);//把a.score(float)地址强制转换成struct student
printf("%5.2f\n",(q->score)); 为什么输出结果却不对,请各位帮忙指点下,谢谢!
printf("%d,%d\n",p,q);
}
[em2][em3][em3][em3][em3]