有以下程序 struc t STU{ char name [10] int num; void f1(struct STU c) { struct STU b={"LiSiGuo",2042}; c=b; } void f2(struct STU *c) { struct STU b={"SunDan",2044); *c=b; } main ( ) { struct STU a={"YangSan",2041},b={"WangYin",2043}; f1 (a); f2 (&b); printf (

题目

有以下程序 struc t STU{ char name [10] int num; void f1(struct STU c) { struct STU b={"LiSiGuo",2042}; c=b; } void f2(struct STU *c) { struct STU b={"SunDan",2044); *c=b; } main ( ) { struct STU a={"YangSan",2041},b={"WangYin",2043}; f1 (a); f2 (&b); printf ( "%d %d\n" ,a.num,b.num); } 执行后输出结果是

A.2041 2044

B.2041 2043

C.2042 2044

D.2042 2043


相似考题
更多“有以下程序struc t STU{ char name [10] int num;void f1(struct STU c){ struct STUb={"LiSiGuo ”相关问题
  • 第1题:

    有以下的结构体变量定义语句: struct student { int num; charname[9]; } stu; 则下列叙述中错误的是()。

    A.结构体类型名为stu

    B.num是结构体成员名

    C.struct是C的关键字

    D.结构体类型名为student


    B

  • 第2题:

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


    stu.birthday.year=1995;stu.birthday.month=11;stu.birthday.day=12;

  • 第3题:

    以下结构体的定义语句中,正确的是______。

    A.struct student {int num; char name[10];int age;};stu;

    B.struct {int num; char name[10];int age;}student; struct student stu;

    C.struct student {int num; char name[10];int age;}stu;

    D.struct student {int num; char name[10]; int age;}; student stu;


    struct student {int nmu; char name[10]; int age;} stu;

  • 第4题:

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


    stu.birthday.year=1995;stu.birthday.month=11;stu.birthday.day=12;

  • 第5题:

    【单选题】已知对学生记录的描述为: 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.birthday.year=1995;stu.birthday.month=11;stu.birthday.day=12;

    C.birthday.year=1995;birthday.month=11;birthday.day=12;

    D.stu.year=1995;stu.month=11;stu.day=12;


    时间维

  • 第6题:

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


    stu.birthday.year=1995;stu.birthday.month=11;stu.birthday.day=12;