下列结构体变量m的成员a的表示应该是。struct xy{int a;double b;}m;
A. m.a
B. m->a
C. *m.a
D. xy.a
查看答案
枚举表中枚举符的默认值和两个枚举符之间默认的差值分别是。
A. 1和0
B. 1和1
C. 0和1
D. 0和0
以下程序运行后的输出结果是。#include struct S{int a,b;}data[2]={10,100,20,200};int main(){struct S p=data[1];printf("%d\n",++(p.a));return 0;}
A. 10
B. 11
C. 20
D. 21
以下程序运行后的输出结果是。#include #include struct A{int a;char b[10];double c;};struct A f(struct A t);int main(){struct A a={1001,"ZhangDa",1098.0};a=f(a);printf("%d,%s,%6.1f\n",a.a,a.b,a.c);return 0;}struct A f(struct A t){t.a = 1002;strcpy(t.b,"ChangRong");t.c=1202.0;return t;}
A. 1001,ZhangDa,1098.0
B. 1002,ZhangDa,1202.0
C. 1001,ChangRong,1098.0
D. 1002,ChangRong,1202.0
设有以下定义:struct complex{int real, unreal;}data1={1,8},data2;则以下赋值语句中错误的是。
A. data2 = (2,6);
B. data2 = data1;
C. data2.real = data1.real;
D. data2.real = data1.unreal;