若有以下定义,则对变量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 student1;
举一反三
- 9.若有以下定义,则对变量student1中“生日”的正确赋值方式是 struct student { int num; char name[20], sex; struct { int year, month, day; } birthday; } ; struct student student1;
- 若有以下定义,则对变量student1中“生日”的正确赋值方式是( )。struct student{ int num; char name[20], sex; struct { int year, month, day; } birthday;} ; struct student student1; 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;
- 已知对学生记录的描述为: struct student { int num; char name[20],sex; struct{ int year,month,day;}birthday; }; struct student stu; 设变量stu中的“生日”是“1995年11月12日”,对“birthday”正确赋值的程序是______。
- 以下变量定义,错误的是: 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
- 已知学生记录描述为: struct student { int num; char name[20]; struct { int year; int month; int day; }birth; }; struct student s; 下列对 “ 生日”的正确赋值方式是( )