p=&d.n
*p=d.n
p=(struct T *)&d.n
p=(struct T *)d.n
第1题:
有以下说明和定义语句 struct student { int age;char num[8]; struct student stu[3]={{20,"200401"},{21,"200402"},{19,"200403"}}; struct student *p=stu;}; 以下选项中引用结构体变量成员的表达式错误的是
A.(p++)->num
B.p->num
C.(*p).num
D.stu[3].age
第2题:
设有如下定义: struct sk { int a; float b; }data; int *p; 若要使p指向data中的a域,正确的赋值语句是 ( )
A.p=&a;
B.p=data.a;
C.p=&data.a,
D.*p=data.a;
第3题:
若有以下说明和语句: 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?
第4题:
设有如下定义:
struct sk
{ int n;
float x; } data, *p;
若要使p指向data中的n域,正确的赋值语句是
A.p=&data.n;
B.*p=data.n;
C.p=(struct sk*)&data.n;
D.p=(struct sk*)data.n;
第5题:
若有以下说明和语句: 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
第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题:
若有下列说明和语句,则对结构体变量st中成员i的引用方式不正确的是( )。 Struct stu { int i; int name; }st,*p; p=&st;
A.st.i
B.*p.i
C.(*p).i
D.p->i
第8题:
设有以下语句 ( ) 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
第9题:
设有以下语句: 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
第10题:
n-1;i++)fo
有以下程序: struct S{int n;int a[20];}; void f(struct S*P) { int i,j,t; for(i=0;i<P->n-1;i++) for(j=j+1;j<P->n-1;j++) if(p->a[i]>p->a[j]) {t=P->a[i];p->a[i]=P->a[j];p->a[j]=t} } main() {int i;struct S s{10,{2,3,1,6,8,7,5,4,10,9}}; f(&s); for(i=0;i<s.n;i++)printf("%d",s.a[i]);} 程序运行后的输出结果是( )。
A.3
B.4
C.5
D.6
第11题:
设有以下程序: 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
第12题:
设有C语句:struct T{int n;double x;}d,*p;,若要使p指向结构体变量中的成员n,正确的赋值语句是()
第13题:
设有如下定义: struct sk { int a;float b; } data; int *p; 若要使p指向data中的a域,正确的赋值语句是( )。
A.p=&a;
B.p=data.a;
C.p=&data.a;
D.p=a;
第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 person
{int ID;char name[12];}P;
请将scanf(“%d”, 【 】);语句补充完整,使其能够为结构体变量P的成员ID正确读人数据。
第16题:
以下对结构体变量mix中成员x的正确引用是______。 struct { int t;int x; }mix,*p; p=&mix;
A.(*p).mix.x
B.(*p).x
C.p->mix.x
D.p.mix.x
第17题:
若定义下列结构体,结构体变量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;
第18题:
设有以下程序: 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
第19题:
设定义下列结构体,结构体变量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;
第20题:
若有以下定义和语句 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,
第21题:
设定义下列结构体,结构体变量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;
第22题:
没有如下定义: Struct sk { int a; float b; }data; int *p; 若要使P指向data中的a域,正确的赋值语句是
A.p=&a;
B.p=data.a;
C.p=&data.a;
D.*p=data.a;
第23题:
假设有如下定义:struct a{int n;float k}data,*p;若要使p指向data中的成员n,正确的赋值语句是
A.p=&data.n;
B.*p=data.n;
C.p=(struct a*)&data.n;
D.p=(struct a*)data.n;
第24题:
p=&d.n
*p=d.n
p=(struct T *)&d.n
p=(struct T *)d.n