【单选题】【消耗次数:1】
下列()对结构类型变量定义是错误的。
structteacher{intnum;intage;}teach1;
struct{intnum;intage;}teach1,teach2;
struct{intnum;intage;}teacher;structteacherteach1;
structteacher{intnum;intage;};structteacherteach1;
参考答案:
复制
纠错
相关题目
【单选题】 若有定义:structteacher{intnum;charsex;intage;}teacher1;则下面叙述错误的是()。
①  struct是结构类型的关键字
②  structteacher是用户定义的结构类型
③  num、sex、age都是结构变量teacher1的成员
④  teacher1是结构类型名
【多选题】 以下对结构体变量stu1中成员age的合法引用是() structstudent {intage; intnum; }stu1;
①  stu1.age
②  stu1.num
③  student.age
④  student.num
【单选题】 若有定义:structstudent{intnum;charname[8];charsex;floatscore;}stu1;则变量stu1所占用的内存字节数是()。
①  15
②  16
③  8
④  19
【单选题】 若有以下类型说明,则叙述错误的是()。typedefunion{charname[10];intage;}ustu,*umy;
①  umy是指向共用体类型ustu的指针类型名
②  ustu是一个共用体类型名
③  umy是一个共用体类型名
④  age是共用体类型ustu的成员
【单选题】 若有下面定义,对结构体变量成员不正确引用的语句是()。structpup{charname[20];intage;intsex;}p[3],*q;q=p;
①  scanf("%s",p[0].name);
②  scanf("%d",q
③  -scanf("%d",(q
④  -scanf("%d",p[0].age);
【单选题】 有以下的定义语句: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);}}
①  1
②  12
③  123
④  1234
【简答题】 假如数组元素是struct Student类型,则在实现换值时,临时变量temp也应定义为[填空1]类型。
【多选题】 以下说法正确的是(  )。#include stdio.hint main(){struct student // 声明结构体类型struct student {int num;char name[20];float score;}student1;
①  student是变量名
②  student是类型名
③  student1是变量名
④  student1类型名
随机题目
【单选题】 有以下程序段int?a[10]={1,2,3,4,5,6,7,8,9,10},*p=&a[3],b;b=p[5];b中的值是()
①  5
②  6
③  8
④  9
【单选题】 使用OS Shell退出Turbo C环境进入DOS后,要想返回Turbo C环境应键入()。
①  RETURN
②  EXIT
③  QUIT
④  BREAK
【单选题】 若变量a,b,c已正确定义并赋值,符合C语言语法的表达式是()
①  ab/c;
②  a/cb
③  ab
④  a*b/c
【单选题】 若定义数组并初始化,运行的结果是() void main( ) { int i,j,a[2][3]={{1,2,3},{4,5,6}}; for(i=0;i for(j=0;j printf(%d,a[i][j]); }
①  1,2,3,4,5,6
②  12345
③  123456
④  无法运行
【单选题】 设a=12,且a定义为整型变量.执行语句a+=a-=a*=a;后a的值为().
①  12
②  144
③  0
④  132
【单选题】 下面程序段a=10;b=0;do{b+=2;a-=2+b;}while(a>=0);中循环的执行次数是()
①  10
②  3
③  5
④  4
【单选题】 下列()对结构类型变量定义是错误的。
①  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;
【单选题】 若有说明int a[3][4];则对a数组元素的正确引用是()
①  a[2][4]
②  a(2)(1)
③  a[1+1][0]
④  a[1,3]
【单选题】 若a是单精度实型变量,c是基本整型变量,以下正确的输入语句是()
①  scanf(%f%d,a,c);
②  scanf(%f%d,&a,&c);
③  scanf(%f%f,&a,&c);
④  scanf(%d%f,&a,&c);
【单选题】 美国信息交换标准代码简称()。
①  ASCII码
②  BCD码
③  GB-32码
④  8421码