A: student1.birthday.year = 2003;student1.birthday.month = 5;student1.birthday.day = 1;
B: year = 2003;month = 5;day = 1;
C: birthday.year = 2003;birthday.month = 5;birthday.day = 1;
D: student1.year = 2003;student1.month = 5;student1.day = 1;
举一反三
- 若有以下定义,则对变量student1中“生日”的正确赋值方式是( )。 struct student { int num; char name[20], sex; struct { int year, month, day; } birthday; } ; struct student student1;
- 9.若有以下定义,则对变量student1中“生日”的正确赋值方式是 struct student { int num; char name[20], sex; struct { int year, month, day; } birthday; } ; struct student student1;
- 已知对学生记录的描述为: struct student { int num; char name[20],sex; struct{ int year,month,day;}birthday; }; struct student stu; 设变量stu中的“生日”是“1995年11月12日”,对“birthday”正确赋值的程序是______。
- 已知对学生记录的描述为: struct student { int num; char name[20],sex; struct{ int year,month,day; }birthday; }; struct student stu;设变量stu中的"生日"是"1995年11月12日",对"birthday"正确赋值的程序是______。 A: year=1995;month=11;day=12; B: stu.year=1995;stu.month=11;stu.day=12; C: birthday.year=1995;birthday.month=11;birthday.day=12; D: stu.birthday.year=1995;stu.birthday.month=11;stu.birthday.day=12;
- 已知对学生记录的描述为:[br][/br] struct student { int num; char name[20],sex; struct{ int year,month,day;}birthday; }; struct student stu; 设变量stu中的“生日”是“1995年11月12日”,对“birthday”正确赋值的程序是______。 A: year=1995;month=11;day=12; B: stu.year=1995;stu.month=11;stu.day=12; C: irthday.year=1995;birthday.month=11;birthday.day=12; D: stu.birthday.year=1995;stu.birthday.month=11;stu.birthday.day=12;
内容
- 0
定义如下结构体来描述一个人的基本情况: struct date {int year; int month; int day; }; struct person {char name[20]; char sex; struct date birthday; }man;如果某人的生日是1988年10月9日,下列对生日的正确赋值是 。 A: man·birthday·year=1988 man·birthday·.month=10 man·birthday·day=9 B: birthday·year=1988birthday·month=10birthday·day=9 C: man·year=1988man·month=10man·day=9 D: year=1988 month=10 day=9
- 1
下面结构体的定义如下:struct student{ char name[32]; struct date{ int day; int month; int year; }birthday;};错误的初始化语句是: A: struct student s1={'Li',1,1,2000}; B: struct student s1={"Li",{1,1,2000}}; C: struct student s1={"Li",1,1,2000}; D: struct student s1={"Li",1,1};
- 2
下面结构体的定义如下:struct student{ char name[32]; struct date{ int day; int month; int year; }birthday;};错误的初始化语句是: A: struct student s1={'Li',1,1,2000}; B: struct student s1={"Li",{1,1,2000}}; C: struct student s1={"Li",1,1,2000}; D: struct student s1={"Li",1,1};
- 3
以下程序的运行结果是 。 struct date { int year; int month; int day; }; struct student{ char name[10]; char sex; struct date birthday; }stu; 结构体变量stu所占字节数为______
- 4
下面结构体的定义如下:struct student{ char name[32]; struct date{ int day; int month; int year; }birthday;};错误的初始化语句是: A: struct student s1={"Li",{1,1,2000}}; B: struct student s1={'Li',1,1,2000}; C: struct student s1={"Li",1,1,2000}; D: struct student s1={"Li",1,1};