题目
#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;
}
如题,求教大神出错原因,为什么不能用->,我知道改成点可以通过编译
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指针用->
如struct student a,*p;
对于a用点,对于p指针用->
举一反三
我想写一篇关于奥巴马的演讲的文章,写哪一篇好呢?为什么好
奥巴马演讲不用看稿子.为什么中国领导演讲要看?
想找英语初三上学期的首字母填空练习……
英语翻译
1,人们染上烟瘾,最终因吸烟使自己丧命.
最新试题
热门考点
- 1一道数学题走一段山路,小红用25分,小刚的时间比小红
- 2Well,i could never imagine an honest boy like john___cheat in the exam
- 3I forgot to bring along the book you borrowed from the library中的along什么意思?有这种说法吗?
- 4we are in a world full of competition 记住自信是通向成功的第一步 翻译
- 5已知数列{an}中,a1=1,an+1=2an-3,则数列{an}的通项公式为( ) A.an=1,n=13−2n−1,n>1 B.an=3+(-2)n C.an=3-2n D.an=-3+2n+1
- 6( )的诗情
- 7某公司周一出勤34人,出勤率为百分之85.后来又有人离去,这时的出勤率是多少?怎样算,为什么这样算
- 8som()is on the table. A.apples B.pears C.salad 要解析
- 9SiO2+2NaOH=NaSiO3+H2O反应SiO2的作用是什么?
- 10宾语从句中是不是一定要有谓语动词