第九章测试
1.定义以下结构体类型struct s{ int a; char b; float f; }; 则语句printf("%d",sizeof(struct s))的输出结果为( )。
A:7 B:13 C:9 D:12
答案:D
2.当定义一个结构体变量时,系统为它分配的内存空间是( )。
A:结构体中各成员所需内存容量之和 B:结构中第一个成员所需的内存容量 C:结构体中占内存容量最大者所需的容量 D:结构中一个成员所需的内存容量 3.定义以下结构体数组 struct c { int x; int y; }s[2]={1,3,2,7};则语句printf("%d",s[0].x*s[1].x)的输出结果为( )。
A:14 B:2 C:6 D:21 4.设有以下说明语句,则下面的叙述正确的是(   )。 typedef struct  { int  a;  float  b; }stutype; 
A:typedef struct是结构体类型名 B:struct是结构体类型名      C:stutype是结构体类型名  D:stutype是结构体变量名  5.运行下列程序段,输出结果是(  )。struct  country       { int  num;          char  name[10];         }x[5]={1,"China",2,"USA",3,"France",4, "England",5, "Spanish"}; struct country *p;    p=x+2;       printf("%d,%c",p->num,(*p).name[2]);  
A:2,U B:3,a  C:5,S D:4,g  

温馨提示支付 ¥3.00 元后可查看付费内容,请先翻页预览!
点赞(4) dxwkbang
返回
顶部