结构体的定义如下: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;
A: st.birth.year =2018;
B: (*p).birth.year = 2018;
C: p->;birth->;year=2018;
D: p->;birth.year = 2018;
举一反三
- 已知学生记录描述为:struct student { int no ; char name[20]; char sex; struct { int year; int month ; int day ; } birth ; } s ;设结构变量 s 中的“birth”是“1985年10月1日”,则下面正确的赋值方式是( ) A: year=1985 month=10 day=1 B: birth.year=1985birth.month=10birth.day=1 C: s.birth.year=1985s.birth.month=10s.birth.day=1 D: s.year=1985 s.month=10 s.day=1
- 已知学生记录描述为:struct student{int no;char name[20];char sex;struct{int year;int month;int day;}birth;}s;设结构变量s中的"birth"应是1985年10月1日“,则下面正确的赋值方式是( ) 未知类型:{'options': ['year=1985month=10day=1', 'birth.year=1985birth.month=10birth.day=1', 's.year=1985s.month=10s.day-1', 's.birth.year=1985s.birth.month=10s.birth.day-1'], 'type': 102}
- 已知学生记录描述为: struct student { int no ; char name[20]; char sex; struct { int year; int month ; int day ; } birth; } s; 设结构变量 s 中的“ birth ”应是“ 1985 年 10 月 1 日”,则下面正确的赋值是:
- 已知学生记录描述为:struct student{int no ;char name[20];char sex;struct{int year;int month;int day ;} birth ;}s ;设结构变量s中的birth值为1985年10月1日,则下面正确的赋值方式是_______。 A: year=1985month=10day=1 B: birth.year=1985birth.month=10birth.day=1 C: s.year=1985s.month=10s.day=1 D: s.birth.year=1985s.birth.month=10s.birth.day=1
- 已知学生记录描述为: struct student { int num; char name[20]; struct { int year; int month; int day; }birth; }; struct student s; 下列对 “ 生日”的正确赋值方式是( )