若有以下定义,能正确引用name成员值为'Z'的是( )。struct Worker {char name; int weight; }m[3]={{'A',61},{'W',62},{'Z',51}};
A. m.name
B. m.name[2]
C. m[2].name
D. name
查看答案
若有以下定义,能正确引用id成员值为4001的是( )。struct Machine {int id; float length; }a[3]={{4001,156.3},{4002,167.5},{4003,160}};struct Machine *p;p=a;
A. p->id
B. (p+1)->id
C. id
D. (a+1)->id
以下程序段的运行结果是( )。struct Player {int id; float h,w; };struct Player a={1601,182.5,75};struct Player b={1602,185.5,72.5};if(a.w>b.w) printf("%d\n",a.id);else printf("%d\n",b.id);
A. 182.5
B. 1601
C. 1602
D. 185.5
以下程序段的运行结果是( )。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]);