若有: struct st1{ int a, b;float x, y;} s1, s2;struct st2{ int a, b;float x, y;} s3, s4;下列说法正确的是( )。
A. 结构变量不可以整体赋值
B. 结构变量 s1、s2、s3、s4 之间均不可以相互赋值
C. 结构变量 s1、s2、s3、s4 之间可以相互赋值
D. 只有结构变量 s1 和 s2、结构变量 s3 和 s4 之间可以相互赋值
查看答案
若有:struct Person{ char name[20] ;int age ;char sex ;} a = {"Li ning", 20, 'M'};则输出结构变量 a 的 age 成员的语句为( )。
A. printf("%d", age);
B. printf("%d", Person.age);
C. printf("%d", a.age);
D. printf("%d", Person.a.age);
若有: 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);