有以下定义和语句struct stu{int n;struct st *next;};

有以下定义和语句struct stu{int n;struct st *next;};

题目
有以下定义和语句struct stu{int n;struct st *next;};
static struct st a[3]={5,&a[1],7,&a[2],9,'\0'},*p;
p=&a[0];,则值为6的表达式是
A.p++->n B.p->n++ C.(*p).n++ D.++p->n
求详解
答案
D.其实是一个链表,p->n指的就是其中的值,p++则指向下一个元素.
A p++->n相当于(&a[0]->n),于是是5
B p->n++相当于(&a[0]->n)++,也是5
C (*p).n++相当于(a[0].n)++,结果也是5
D ++p->n相当于++(p->n),结果6
举一反三
我想写一篇关于奥巴马的演讲的文章,写哪一篇好呢?为什么好
奥巴马演讲不用看稿子.为什么中国领导演讲要看?
想找英语初三上学期的首字母填空练习……
英语翻译
1,人们染上烟瘾,最终因吸烟使自己丧命.
最新试题
热门考点

超级试练试题库

© 2017-2019 超级试练试题库,All Rights Reserved.