题目内容

设已有定义: int a[8]={1,2,3,4,5,6,7,8},*p; 下列语句中正确的是( )。

A. for(p=a;a<(p+8);a++);
B. for(p=a;p<(a+8);p++);
C. for(p=a,a=a+8;p
D. for(p=a;a

查看答案
更多问题

若有定义:int c[5],*p=c;则以下c数组元素地址的正确引用是( )。

A. p+5
B. c++
C. &c+1
D. &c[0]

以下选项中,不能定义s为合法的结构变量的是( )

A. struct abc{ double a; charb[10];}s;
B. struct{ double a;char b[10];}s;
C. struct ABC{ double a; char[10];};
D. struct s{ double a;char b[10];};

有定义“struct ex{ intx; float y; char z;}example;”;,下面叙述中不正确的是( )

A. struct是定义结构类型的关键字
B. example是结构类型名
C. x,y,z都是结构成员名
D. struct ex是结构类型名

下列程序的输出结果是( )#include #include typedef struct{char name[9];char gender;float score[2];} STU;void f(STU a){STU b= {"Zhao",'m',85.0,90.0};int i;strcpy(a.name,b.name);a.gender=b.gender;for(i=0; i<2; i++)a.score[i]=b.score[i];}int main(void){STU c= {"Qian",'f',95.0,92.0};f(c);printf("%s,%c,%2.0f,%2.0f\n",c.name,c.gender,c.score[0],c.score[1]);}

A. Qian,f,95,92
B. Qian,m,85,90
C. Zhao,f,95,92
D. Zhao,m,85,90

答案查题题库