更多"[单选题]有以下程序段
struct st
{int x;int *"的相关试题:
[单选题]有以下程序段
struct st
{int x;int *y;}*pt;
int a[]={1,2},b[]={3,4};
struct st c[2]={10,a,20,b};
pt=c;
以下选项中表达式的值为11的是()。
A.*pt->y
B.pt->x
C.++pt->x
D.(pt++)->x
[单选题]设有以下程序段,则值为6的表达式是( )。
struct st { int n; struct st *next;};
static struct st a[3]={5,&a[1],7,&a[2],9,0 },*p;
p=&a[0];
A.p++->n
B. ++p->n
C. p->n++
D.(*p).n++
[单选题]以下程序的输出是()。
struct st
{ int x; int *y;} *p;
int dt[4]={ 10,20,30,40 };
struct st aa[4]={ 50,&dt[0],60,&dt[0],60,&dt[0],60,&dt[0],};
main()
{ p=aa;
printf("%d\n",++(p->x));
}
A.10
B.11
C.51
D.60
[单选题]有以下程序
int fun(int x,int y,int *cp,int *dp)
{ *cp=x+y; *dp=x-y; }
main()
{ int a, b, c, d;
a=30; b=50;
fun(a,b,&c,&d);
printf("%d,%d\n", c, d);
}
输出结果是()。
A.50,30
B.30,50
C.80,-20
D.80,20
[单选题]有以下程序
int fun(int x[],int n)
{static int sum=0,i;
for(i=0;iA.45
B.50
C.60
D.55
[单选题]下面程序的输出结果为()。
struct st
{ int x;
int *y;
} *p;
int dt[4]={10,20,30,40};
struct st aa[4]={ 50,&dt[0],60,&dt[1],70,&dt[2],80,&dt[3] };
main()
{ p=aa;
printf("%d\n", ++p->x );
printf("%d\n", (++p)->x);
printf("%d\n", ++( *p->y));
}
A.10
20
20
B.50
20
20
C.51
60
21
D.60
70
31
[单选题]定义struct st
{int x;
float y;
double z;
} b;
则b是字节数 。
A.4
B.8
C.10
D.16
[单选题]有以下程序
int add(int a,int b){return+b};}
main()
{int k,(*f)(),a=5,b=10;
f=add;
... }则以下函数调用语句错误的是()。
A.k=(*f)(a,b);
B.k=add(a,b);
C.k=*f(a,b);
D.k=f(a,b);
[单选题]有以下程序
fun(int x,int y)
{static int m=0,i=2; i+=m+1;m=i+x+y; return m; }
main()
{int j=1,m=1,k;
k=fun(j,m); printf("%d,",k);
k=fun(j,m);
printf("%d\n",k);
}
执行后的输出结果
A.5,5
B.5,11
C.11,11
D.11,5
[单选题]以下程序的输出结果是()。
func(int a,int b)
{ int c;
c=a+b;
return c;}
main( )
{ int x=6,y=7,z=8,r=0;
r=func((x--,y++,x+y),z--);
printf(“%d\n”,r);}
A.11
B.20
C.21
D.31