A. (*pw).s.year=1980; B. w.year=1980; C. pw‐>year=1980; D. pw.s.year=1980;
举一反三
- 已知学生记录描述为:struct student{ int num; char name[20]; struct { int year;int month;int day;}birth;};struct student s;下列对“生日”的正确赋值方式是( ) A: year=1980; month=6; day=11; B: birth.year=1980;birth.month=6;birth.day=11; C: s.year=1980; s.month=6; s.day=11; D: s.birth.year=1980; s.birth.month=6; s.birth.day=11;
- 08110062:已知职工记录描述为: struct workers{ int no; char name[20]; char sex; struct{ int day; int month; int year; }birth; }; struct workers w; 设变量w中的“生日”应是“1993年10月25日”,下列对“生日”的正确赋值方式是()。
- 已知学生记录及变量的定义如下struct student{ int no;char name[20];char sex; struct{ int year,month,day;}birth;}struct student s,*ps;ps=&s;以下能给s中的year成员赋值的语句是 A: s.year=1984; B: ps.year=1984; C: ps->year=1984; D: s.birth.year=1984;
- 下列有关结构体的定义错误的是_______。 A: typedef date { int year,month,day ;} type_date; B: struct { char name[10] ; float angle ;}; C: typedef struct date { int year,month,day ;} type_date ; D: struct date { int year,month,day ;} type_date ;
- 以下结构体数组定义,不正确的是______。 A: struct date{ int year; int month; int day;}date1[10],date2[10]; B: struct{ int year; int month; int day;}date1[10],date2[10]; C: struct date{ int year; int month; int day;}; ..... struct datedate1[10],date2[10]; D: struct datedate1[10],date2[10];.....struct date{ int year; int month; int day;};
内容
- 0
【填空题】如有以下定义和语句,则sizeof(a) = (),sizeof(b) = ()。 struct { int day; char month; int year;}a,*b;
- 1
已知学生记录描述为: struct student { int num; char name[20]; struct { int year; int month; int day; }birth; }; struct student s; 下列对 “ 生日”的正确赋值方式是( )
- 2
若有以下定义,则对变量student1中“生日”的正确赋值方式是( )。 struct student { int num; char name[20], sex; struct { int year, month, day; } birthday; } ; struct student student1;
- 3
9.若有以下定义,则对变量student1中“生日”的正确赋值方式是 struct student { int num; char name[20], sex; struct { int year, month, day; } birthday; } ; struct student student1;
- 4
程序:class Birthday{int year;int month;int day;public Birthday(int year,int month,int day){year = year; month = month; day = day;}public static void main(String[] args){Birthday birth = new Birthday(1980,10,22); System.out.println(year);}}程序运行后的输出是哪项? A: 1980 B: 10 C: 22 D: 0 E: 编译出错