以下程序段的运行结果是( )。struct M {int id; int length; };struct M a={101,156};struct M b={102,167};struct M c={103,160};int i;i=a.length+b.length-c.length;printf("%d\n",i);
A. 163
B. 171
C. 169
D. 327
查看答案
若有以下定义,能正确输出letter成员值为'D'的语句是( )。struct Table {int id; char letter; };struct Table a[5]={{1,'A'},{2,'B'},{3,'C'},{4,'D'},{5,'E'}};
A. printf("%c\n",a[3].letter);
B. printf("%c\n",a.letter);
C. printf("%c\n",letter);
D. printf("%c\n",a.letter[3]);
若已定义:struct st { int num; struct ym { int y; int m; }birthym; }st1;下列能对结构变量st1的成员y进行正确赋值的是( )。
A. st.birthym.y=1998;
B. st1.struct ym.y=1998;
C. st1.birthym.y=1998;
D. birthym.y=1998;
若有以下定义,能输出字母'G'的语句是( )。struct stu { char name[9]; int age;};struct stu s[5]={"Zheng",16,"Lin",18,"Yang",19,"Guo",20};
A. printf("%c\n",s[3].name[0]);
B. printf("%c\n",s[4].name[0]);
C. printf("%c\n",struct.name[0]);
D. printf("%c\n",name[4][0]);
若已定义:struct Book{char *name; float price;}b1,*p=&b1;下列对结构变量book1中成员price的合法引用是( )。
A. p.price
Book.price
C. p->price
D. b1->price