题目内容

若有: struct{ int a;float b;} data, *p;p = &data;则对 data 中的成员 a 的正确引用是( )。

A. (*p).data.a
B. *p.a
C. p->a
D. p.data.a

查看答案
更多问题

若有: struct {int age;int num;} std, *p = &std;能正确引用结构变量 std 中成员 age 的表达式是( )。

A. *p.age
B. std->age
C. (*p).age
D. *std->age

若有: struct Person{ int num;char name[20], sex;struct{int class;char prof[20]; } in;} a = {20, "LiNing", 'M', {5, "computer"}}, *p = &a;下列语句中,正确的是( )。

A. printf("%s", a->name);
B. printf("%s", p->in.prof);
C. printf("%s", *p.name);
D. printf("%s", p->in->prof);

若有:struct{ union { char a,b; int c; } d;int e[5]; } f, *p = &f;则下列语句正确的是( )。

A. p.d.a = '*';
B. p->e[3] = 10;
C. p->b = ' ';
D. p->d->c = 20;

下列程序的输出结果是________。#includestruct ABC{int a, b, c;};int main(void){ int t;struct ABC s[2] = {{1, 2, 3}, {4, 5, 6}};t = s[0].a + s[1].b;printf("%d\n", t);return 0;}

答案查题题库