• 2022-05-26
    已知学生记录及变量的定义如下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;
  • D

    举一反三

    内容

    • 0

      已知学生记录描述为: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

    • 1

      已知学生记录描述为 struct student { int no; char name[20]; char sex; struct { int year; int month; int day; } birth; }; struct student s;变量s中的“生日”应是“1985年4月4日”,下列对“生日”的正确赋值方式是______。 A: year=1985;month=4;day=4; B: birtyear=1985;birtmonth=4;birtday=4; C: year=1985;month=4;day=4; D: birtyear=1985;birtmonth=4;birth,day=4;

    • 2

      已知学生记录描述为: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

    • 3

      已知学生记录描述为: struct student { int no ; char name[20]; char sex; struct { int year; int month ; int day ; } birth; } s; 设结构变量 s 中的“ birth ”应是“ 1985 年 10 月 1 日”,则下面正确的赋值是:

    • 4

      已知学生记录描述为: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;