(*p).n++
p++->n
p->n++
(++p)->n
第1题:
以下程序的输出是______。 struct st {int x;int*y; }*p; int dt[4]={10,20,30,40}; struct st aa[4]={50,&dt[0],60,&dt[1],60,&dt[2],60,&dt[3]}; main() { p=aa; printf("%d\n",++(p->X)); }
A.51
B.11
C.50
D.60
第2题:
若有以下程序段: struct st {int n; int*m: }; int a=2,b=3,c=5; struct st s[3]=({101,&a},{102,&c},{103,&B)}; main() {struct st*p; p=s; } 则以下表达式中值为5的是( )。
A.(*p).m
B.*(p+1)->m
C.*(p++)->n
D.(p++)(*m)
第3题:
下列程序的输出结果是( )。 #include <stdio.h> main() { struct st { int y,x,z; }; union { long i; int j; char k; } un; printf("%d,%d\n",sizeof(struct st),sizeof(un)); }
A.6, 2
B.6, 4
C.8, 4
D.8, 6
第4题:
有以下程序 #include <stdio.h> struct st { int x,y;} data[2]={1,10,2,20}; main() { struct st *p=data; printf("%d,",p->y); printf("%d\n",(++p)->x); } 程序的运行结果是______。
A.10,1
B.20,1
C.10,2
D.20,2
第5题:
若定义下列结构体,结构体变量p的出生年份赋值正确的语句是( )。 struct st { int x; int y; int z; } struct worker { char name[20]; char sex; struct st birth; }p;
A.x=1987
B.birth.x=1987;
C.p.birth.x=1987;
D.p.x=1987;
第6题:
设定义下列结构体,结构体变量p的出生年份赋值正确的语句是( )。
Struct st
{ int x;
inty;
int z;
}
Struct worker
{ char name[20];
char sex;
struct st birth;
}p;
A.x=1987
B.birth.x=1987;
C.p.birth.x=1987;
D.p.x=1987;
第7题:
设有以下程序: struct st{int n;struct st *next;}; static struct st a[3]={5,&a[1],7,&a[2],9,'\0'},*p; p=&a [0]; 下面选项中,表达式值为6的是______。
A.p++->n
B.p->n++
C.(*p).n++
D.++p->n
第8题:
设定义下列结构体,结构体变量p的出生年份赋值正确的语句是( )。 stmct st { int x; int y; int z; } struct worker { char name[20]; char sex; struct st birth; }p;
A.x=1987
B.birth.x=1987;
C.p.birth.x=1987;
D.p.x=1987;
第9题:
若有以下定义和语句 struct a{ int n,m;}; struct a st[3]={{2,3},{4,5},{6,7}}; struct a*p=st;则以下错误的引用是A.(p++)->n; B.st[0].n; C.(*p).n; D.P=&st.m,
第10题:
设有以下程序: struct st{int n;struct st*next;}; static struct st a[3]={5,&a[1],7,&a[2],9,'\0\},*p; p=&a[0];下面其值为6的表达式为______。
A.p++->n
B.p->n++
C.(*p).n++
D.++p->n
第11题:
有以下程序
#inGlude<stdlib.h>
struct NODE {
int num;
struct NODE *next;
}
main()
{ struct NODE *p,*q,*r;
int sum=0;
p=(struct NODE*)malloc(sizeof(struct NODE));
q=(struct NODE*)malloc(sizeof(struct NODE));
r=(stnlct NODE*)malloc(sizeof(struct NODE));
p->num=1;q->num=2;r->num=3;
p->next=q;q->next;r;r->next=NULL;
sum+=q->next->Num,sum+=p->num;
printf("%d\n",sum);
}
执行后输出结果是
A.3
B.4
C.5
D.6
第12题:
for(i=0; i<10; i++) fwrite(x,sizeof(struct st), 1,fp);
fwrite(x,10*sizeof(struct st), 1,fp);
fwrite(x,sizeof(struct st), 10,fp);
for(i=0; i<10; i++) fwrite(&x[i],sizeof(struct st), 1,fp);
第13题:
下列程序的输出结果是( )。 #include<stdio.h> main() { struct st { int y,x,z; }; union { long i; int j; char k; }un; printf("%d,%d\n",sizeof(struct st),sizeof(un)); }
A.6,2
B.6,4
C.8,4
D.8,6
第14题:
设有以下程序段:struct st{int n;struct st *next;};static struct st a[3]={5,&a[1],7,&a[2],9,'\0'),*p;p=&a[0];下面选项中,其值为6的表达式为______。
A.P++->n
B.p->n++
C.(*p).n++
D.++p->n
第15题:
若有以下说明和语句: struct st{int n;char*ch;} struct st a[3]={5,"abc"7,"def",9",ghk"),*p=a; 则值为6的表达式是______。
A.p++->n
B.p->n++
C.(*p).n++
D.#NAME?
第16题:
若有以下说明和语句: struct st{int n;char * ch;}; struct st a[3]={5,"abc",7,"def",9,"ghk"},*p=a; 则值为6的表达式是 ______。
A.p++->n
B.p->n++
C.(*p).n++
D.++p->n
第17题:
有以下程序
#include <stdlib.h>
struct NODE{
int num;
struct NODE *next;};
main( )
{ struct NODE *p,*q,*r;
int sum=0;
p=(struct NODE *)malloc(sizeof(struct NODE));
q=(struct NODE *)malloc(sizeof(struct NODE));
r=(struct NODE *)malloc(sizeof(struct NODE));
p->num=1;q->num=2;r->num=3;
p->next=q;q->next=r;r->next=NULL;
sum+=q->next->num;sum+=p->num;
printf(“%d\n”,sum);}
执行后的输出结果是
A.3
B.4
C.5
D.6
第18题:
若有下列说明和语句,已知int型数据占2个字节,则下列语句的输出结果是( )。 struct st { char a[15]; int b; double c; }; printf("%d",sizeof (struct st));
A.15
B.8
C.25
D.2
第19题:
若有下列说明和语句,则对结构体变量st中成员i的引用方式不正确的是( )。 Struct stu { int i; int name; }st,*p; p=&st;
A.st.i
B.*p.i
C.(*p).i
D.p->i
第20题:
设有以下语句 ( ) struct st {int n;struct st * next;}; static struct st a [3]={5,&a [1],7,&a[2],9,'\0'},*p; p=&a[0] 则表达式( )的值是6。
A.p+ + ->n
B.p->n + +
C.(* P). n+ +
D.+ +p - >n
第21题:
有以下程序:
#include <stdlib.h>
struct NODE
{ int num; struct NODE *next; };
main()
{ struct NODE *p,*q,*r;
p=(struct NODE*)malloc(sizeof(struct NODE));
q=(struct NODE*)mallloc(sizeof(struct NODE));
r=(struct NODE*)malloc(sizeof(struct NODE));
p->num=10;q->num=20; r->num=30;
p->next=q;q->next=r;
printf("%d\n",p->num+q->next->num);
}
程序运行后的输出结果是( )。
A.10
B.20
C.30
D.40
第22题:
以下程序的输出结果是 ( ) 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
第23题:
以下对结构体类型变量td的定义中,错误的是( )。
A.typcdef struct aa { int n; float m; } AA; AA td;
B.struct aa {int n; float m; } struct aa td;
C.struct {int n; float m; } aa; struct aa td;
D.struct {int n; float m; }td;
第24题:
p->n++
(*p).n
++(p->n)
p->n