• 2022-06-19
    一下选项中,定义结构体变量错误的是( )
    A: struct student {int num; char name[30];
    }wangming;
    B: struct {int num; char name[30];
    }wangming;
    C: struct student {int num; char name[30];
    }; struct student wangming;
    D: struct student {int num; char name[30];
    }; student wangming;
  • D

    内容

    • 0

      下面定义结构变量的语句中错误的是。 未知类型:{'options': ['struct student{ int num; char name[20]; } s;', 'struct { int num; char name[20]; } s;', 'struct student{ int num; char name[20]; }; struct student s;', 'struct student{ int num; char name[20]; }; student s;'], 'type': 102}

    • 1

      struct student { int num; char sex; char name[20]; float score; } st ; 其中num是结构体 ________

    • 2

      有以下定义的结构体: typedef struct student { int num; char name[10]; int age; } stu1; 则,struct student 是结构体变量名。

    • 3

      下列声明结构体变量错误的是( ) A: A.struct student  { int no; char name[16]; }st1,st2; B: B. struct student{ int no;char name[16];};struct student st1,st2; C: C.struct student { int no; char name[16]; }; struct st1,st2; D: D.struct student{ int no;char name[16]; };student st1,st2;

    • 4

      以下对结构体类型的变量定义中不正确的是 。 A: B: define STUD struct student STUD {long num; char name[20]; char sex; float score;}; STUD stud1,stud2; C: struct student {long num; char name[20]; char sex; float score; }stud1,stud2; D: struct {long num; char name[20]; char sex; float score; } stud1,stud2; E: struct {long num; char name[20]; char sex; float score; }student;struct student stud1,stud2;