• 2022-06-16
    以下对结构体变量stu成员age的非法引用是( )。 struct
    student {
    int num;
    int age; }; struct
    student stu,*p=&stu;
    A: stu.age
    B: (*p).age
    C: student.age
    D: p->age
  • C

    内容

    • 0

      若有以下定义和语句:struct student{ int num ; int age ;} ;struct student stu[3] = {{1001,20} ,{1002,19},{1003,21}} ;main ( ){struct student*p ;p = stu ;. . .}则以下不正确的引用是( )。 A: (p+ + )->; age B: p + + C: (*p).age D: p = &stu. num

    • 1

      设有如下语句:struct student{int num;int age;};struct student stu[3]={{101,18},{102,21},{103,19}};struct student *p=stu;则下面表达式的值为102的是( ) A: (p++)->num B: (p++)->age C: (*p).age D: (*++p).num

    • 2

      若有下列语句,则以下引用方式不合法的是( )。 struct student { int num; int age; }; struct student stu[3]={{101,20}, {102,19}, {103,20}}, *p=stu;

    • 3

      struct student{ int age; char num[8];};struct student stu[3]={{20,"200401"},{21,"200402"},{19,"200403"}};struct student *p=stu;以下选项中引用错误的是___ __。 A: (p++)->;num B: p->;num C: (*p).num D: stu[3].age

    • 4

      22. 以下对结构体类型变量的定义错误的是( )。 A: B: define STU struct student STU {float height; int age; }std1; C: struct student {float height; int age; }std1; D: struct {float height; int age; }std1; E: struct {float height; int age; }student; struct student std1;