A: st.num=1001;
B: st.name="Jack";
C: (*p).num=1002;
D: p->;num=1003;
举一反三
- 若有以下定义,则下列赋值语句中不正确的是。 struct student { int num; char name[20]; }st,*p=&st;
- 若有以下定义,st已赋初值,则printf语句的输出结果是。 struct student { int num; char name[20]; }st={1001,"Jack"}; printf("%d,%s ",st);
- struct student { int num; char sex; char name[20]; float score; } st ; 给st的num成员赋值为16,应写出的语句是 ;
- struct student { int num; char sex; char name[20]; float score; } st ; 其中num是结构体 ________
- 结构体的定义如下:struct{ int num; char name[10]; char sex;struct { int year; int month; int day; } birth;} st, *p=&st;则下面错误的赋值语句是( )。 A: st.birth.year =2018; B: (*p).birth.year = 2018; C: p->;birth->;year=2018; D: p->;birth.year = 2018;
内容
- 0
已知: struct st{ int num; char sex; float score; }stud,*p=&stud; 则对于结构体变量stud的成员num正确的引用是____。 A: stud->num B: st.num C: p->num D: p.num
- 1
若已定义:struct Student {int num; char name[20];}stu,*p; p=&stu;,要访问stu中的num成员,可使用【】。 A: *stu.num B: p->;num C: stu->;num D: p.num
- 2
若有以下定义和语句:struct student { int age,num ; }; struct student stu[3]={{1001,20},{1002,19},{1003,21}}; int main() { struct student *p=stu; … }则以下正确的引用是()。 A: (p++)->num B: ++p->num C: (*p).num D: p->num
- 3
已知:[br][/br] struct st { int num; char sex; float score; }stud,*p=&stud; 则对于结构体变量stud的成员num正确的引用是______。 A: stud->num B: st.num C: p->num D: p.num
- 4
以下变量定义,错误的是: A: struct student{int num, char name[20];} s; B: struct {int num, char name[20];} s; C: struct student{int num, char name[20];}; struct student s; D: struct student{int num, char name[20];} ; student s