当前位置: > #include...
题目
#include
struct student
{
long num;
float score;
struct student *next;
};
int main()
{struct student a,b,*p;
a.num=231231;
b.num=311;
b.score=2.0;
a.score=1.0;
a.next=&b;
p=a->next; error:invalid type argument of '->' (have 'struct student')
printf("%ld",p->num);
return 0;
}
如题,求教大神出错原因,为什么不能用->,我知道改成点可以通过编译

提问时间:2021-12-20

答案
指针才用->
如struct student a,*p;
对于a用点,对于p指针用->
举一反三
我想写一篇关于奥巴马的演讲的文章,写哪一篇好呢?为什么好
奥巴马演讲不用看稿子.为什么中国领导演讲要看?
想找英语初三上学期的首字母填空练习……
英语翻译
1,人们染上烟瘾,最终因吸烟使自己丧命.
版权所有 CopyRight © 2012-2019 超级试练试题库 All Rights Reserved.