习题十一
一、选择题
11-1. 下面的四个运算符中,优先级最低的是。
A ( )
B 成员运算符.
C 指针运算符->
D ++
11-2. 已知:
struct {
int i;
char c;
float a;
} test;
则sizeof(test)的值是。
A.4 B.5 C.6 D.7
11-3. 已知:
union {
int i;
char c;
float a;
} test;
则sizeof(test)的值是。
A.4 B.5 C.6 D.7
11-4. 选择出错误的函数定义。
A.struct tree funa(struct tree *s)
B.int *funb(tree s)
C.struct tree *func(struct tree s)
D.int *fund(s)
11-5. 以下对C语言中联合类型数据的正确叙述是。
A.一旦定义了一个联合变量后,即可引用该变量或该变量中的任意成员
B.一个联合变量中可以同时存放其所有成员
C.一个联合变量中不能同时存放其所有成员
D.联合类型数据可以出现在结构体类型定义中,但结构体类型数据不能出现在联合类型定义中
11-6. 已知函数原型为:
struct tree *f (int x1, int *x2, struct tree x3, struct tree *x4)
其中tree为已定义过的结构,且有下列变量定义:
struct tree pt, *p; int i;
请选择正确的函数调用语句。
A.&pt=f(10,&i,pt,p); B.p=f(i++, (int *)p, pt, &pt);
C.p=f(i+1, &(i+2), *p, p); D.f(i+1, &i, p, p);