有以下程序#include struct ord{int x,y;}dt[2]={1,2,3,4};main(){struct ord *p=dt;printf("%d,",++p->x);printf("%d,",++p->y);}程序的运行结果是( )
A. 1,2
B. 2,3
C. 3,4
D. 4,1
下列结构体的定义语句中,错误的是()
A. struct ord{int x;int y;int z;};struct ord a;
B. struct ord{int x;int y;int z;}struct ord a;
C. struct ord{int x;int y;int z;}a;
D. struct {int x;int y;int z;}a;
有以下程序,程序运行后的输出结果是( )#include #include structA{inta;charb[10];doublec;}struct A f(struct A t);main(){structA a={1001,"ZhangDa",1098.0};a=f(a);printf("%d,%s,%6.1f\n",a.a,a.b,a.c);}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. 1022,ZhangDa,1202.0
C. 1001,ChangRong,1098.0
D. 1002,ChangRong,1202.0
设有定义:struct complex{int real,unreal;}data1={1,8},data2;则赋值语句中错误的是( )
A. data2=data1;
B. data2=(2,6);
C. data2.real=data1.real;
D. data2.real=data1.unreal;