【单选题】
若有定义:structteacher{intnum;charsex;intage;}teacher1;则下面叙述错误的是()。
②
structteacher是用户定义的结构类型
③
num、sex、age都是结构变量teacher1的成员
【多选题】
以下对结构体变量stu1中成员age的合法引用是() structstudent {intage; intnum; }stu1;
【单选题】
若有定义:structstudent{intnum;charname[8];charsex;floatscore;}stu1;则变量stu1所占用的内存字节数是()。
【单选题】
若有以下类型说明,则叙述错误的是()。typedefunion{charname[10];intage;}ustu,*umy;
【单选题】
若有下面定义,对结构体变量成员不正确引用的语句是()。structpup{charname[20];intage;intsex;}p[3],*q;q=p;
【单选题】
有以下的定义语句:structstudent{intnum;charname[9];};则不能正确定义结构数组并赋初始值的是()。
①
structstudentstu[2]={1,zhangsan,2,lisi};
②
structstudentstu[2]={{1,zhangsan},{2,lisi}};
③
structstu[2]={{1,zhangsan},{2,lisi}};
④
structstudentstu[]={{1,zhangsan},{2,lisi}};
【单选题】
下列()对结构类型变量定义是错误的。
①
struct teacher {int num; int age; } teach1;
②
struct {int num; int age; } teach1, teach2;
③
struct {int num; int age; } teacher; struct teacher teach1;
④
struct teacher {int num; int age; } ; struct teacher teach1;
【单选题】
下面程序的运行结果是()#includestdio.hmain(){intnum=0;while(num=2){num++;printf(“%d,num);}}
【简答题】
假如数组元素是struct Student类型,则在实现换值时,临时变量temp也应定义为[填空1]类型。
【多选题】
以下说法正确的是( )。#include stdio.hint main(){struct student // 声明结构体类型struct student {int num;char name[20];float score;}student1;