Student是已定义的一个类,那么执行语句"Student stu1,stu2(3),*stu3,*stu4;",调用了次构造函数
举一反三
- 若有定义:struct student{ int age; int num;};struct student stu,*p;则以下正确的赋值语句是()。 A: p=stu; B: *p=*stu; C: *p=&stu; D: p=&stu;
- 若有以下定义语句,则以下错误的引用是( )。 struct student {int num,age;}; struct student stu[3]={{101,20},{102,19},{103,18}},*p=stu;
- 已知有typedef struct student STU;下面和struct student s1;等效的是?() A: STU s1; B: student STU s1; C: struct STU s1; D: typedef STU s1;
- 下列选项中不能够定义一个结构体类型变量stu的是 。 A: struct student { int num; int age; } stu; B: struct student { int num; int age; }; student stu; C: struct {int num; int age; } stu; D: struct student {int num; int age; }; struct student stu;
- 对以下定义,能输出字符串"Mary"的语句是( )。struct student { char name[20]; int age; }; struct student stu[100]={"John",16,"Paul",17,"Mary",18 }; A: printf("%s",stu[2].name); B: printf("%s",stu[1].name); C: printf("%s",stu[2]); D: printf("%s",stu[1]);