高级语言程序设计
VIP题库
设有下列数据定义语句,则printf(”%d\nn,d[0].y/a[0]。x*d[1].x);的输出是()struct{intx;inty;}d[2]={{1,3},{2,7};;
运行下列程序段,输出的结果是() structcountry {intnum; charname[20];} x[5]={1,"China",2,"USA",3,"Era/icett4,"England",5,Spanish"}; structcountry*P; inti=3; p=x; prinff("\n%d,%s",(*(P+i)).num,(*(P+i)).name);
函数f()定义如下,对其中的形参abc2来说,数据传递方式是属于____方式(填单向传递或双向传递)。structABC{inta;intb;intc;};intf(structABCabc2){return(abc2.a);}
运行下列程序后输出的结果是() structcountry {intnum; charname[20]; }x[5]={1,"China",2,"USA",3,France",4,"England",5,Spanish"}‘; structcountry*P; P=x+2; prinff("%d,%s",P->num,x[3].name);
成员运算符是双目中缀运算符,其前一个运算对象只能是____(填数据类型)的变量或数组元素。
成员运算符的符号是____,它是一个双目中缀运算符,前一个运算对象必须是____,后一个运算对象必须是____。
阅读下列程序,写出程序运行的输出结果(设当前系统日期为2006年8月4日)。 #include void main() {stmctdate x={1972,10,3}; stmctdate y,*P=&y; getdate(P);/*获取系统日期*/ printf("%d\n",P->da_year-x.da_year);/*输出两个年份的差值,2006—1972*/ }
设有数据定义语句“struct{charn[10];Iongm[10];)x;”,则为变量x所分配的内存字节数是____个。
设有下列数据定义语句,则和语句“ARRAY*p;”功能相同的是()typedef int ARRAY[10];
阅读下列程序,写出程序运行的输出结果。 struct s{inta;int*b;}*p; int c[]={10,20,30,40}; stmctsd[]={50,c,60,c+1,70,c+2,80,c+3}; void main() {p=d; printf("%d,",++P->a);prinff("%d,",(++P)->a);printf("%d\n",++(*P->b)); }/*P->a的值为50,++P->a的值为51;(++p)->a中P自加后指向d[1],因此值为60;(*P->b)为20,自加后为21*/
«
1
2
...
74
75
76
77
78
79
80
...
82
83
»