1、|10,00,00|(1) 设有下列程序段,则 scanf 函数调用语句中对结构体变量成员的不正确引用为( ) 。struct student char name20;int age;char sex; stu5,*p;p=stu;A) scanf (“%s“,stu0.name);B) scanf(“%d“,p-age);C) scanf(“%c“,D) scanf(“%d“,10|B|(2) 若定义如下结构,则能打印出字母 M 的语句是( ) 。struct personchar name9;int age;struct person class10=“Wujun“,20,“Liudan“
2、,23,“Maling“,21,“zhangming“,22;A) printf(“%cn“,class3.name);B) printf(“%cn“,class2.name0);C) printf(“%cn“,class2.name1);D) printf(“%cn“,class3.name1);10|B|(3) 在 C 程序中,使用结构体的目的是( ) 。A)将一组相关的数据作为一个整体,以便程序使用。B)将一组相同数据类型的数据作为一个整体,以便程序使用。C)将一组数据作为一个整体,以便其中的成员共享存储空间。D)将一组数值一一列举出来,该类型变量的值只限于列举的数值范。10|A|(4)
3、 设有 100 个学生的考试成绩数据表如下形式:学号 no 整型姓名 name 字符数组型成绩 score 实型在下面结构数组的定义中,不正确的是( )。A)struct student int no; char name10;float score; struct student stud100;B)struct stud100int no;char name10;float score;C)struct student int no; char name10;float score; stud100;D)struct int no; char name10;float score; stu
4、d10;10|B|(5) 下列程序的输出结果为( )。(数据类型 long ,int ,char 的长度分别为 4,2,1 个字节)# include main ()union long k;int i6;char c4;r;printf(“%dn“,sizeof(r) );A)4B)6C)12D)2010|C|(6) 下列程序运行的正确结果是( )。main()union int count2char ch4; un;int i;char letter=6;for(i=0;i main( )void func( );struct date int a;char s 5;arg;arg.a=27;strcpy( arg.s, “abcd“);func(printf(“ arg.a=%d,arg.s=%sn“, arg.a ,arg.s);void func ( int *x,char s1 ) *x-=5;strcpy (s1 ,“ABCD“);A)arg.a=22,arg.s=ABCDB)arg.a=27,arg.s=abcdC)arg.a=22,arg.s=abcdD)arg.a=27,arg.s=ABCD10|A|(11)