若有以下定义和语句 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,
第1题:
若有以下程序段: 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)
第2题:
若有以下说明和语句: 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?
第3题:
有以下程序: #include <stdio.h> main( ) { struct node{int n; struct node*next;} *P; struct node x[3]={{2,x+1),{4,x+2},{6,NULL}}; P= X; printf("%d,",p->n); printf("%d\n",p->next->n); } 程序运行后的输出结果是( )。
A.2,3
B.2,4
C.3,4
D.4, 6
第4题:
以下对结构体类型变量td的定义中,错误的是 ______。
A.typedef struct aa
B.struct aa {int n; {int n; float m; float m; }AA; }td; AAtd; struct aa td;
C.struct
D.struct {int n; {int n; float m; float m; }aa; }td; struct aa td;
第5题:
设有以下程序: 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
第6题:
以下对结构体类型变量td的定义中,错误的是______。
A.typedef struct aa { int n; float m; }AA; AA td;
B.struct aa { int n; float m; }td; struct aa td;
C.struct { int n; float m; }aa;
D.struct { int n; float m; }td; struct aa td;
第7题:
以下对结构体类型变量td的定义中,错误的是
A.typedef struct aa { int n; float m; }AA; AA td;
B.stmct aa{ int n;float m;}td;stmct aa td;
C.struct { int n; float m; }aa; struct aa rd;
D.struct{ int n;float m;}td;
第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 a { int n,m;}; struct a st[3]={{1,20},{2,19},{3,21}}; struct a*p=st; 则以下错误的引用是
A.(p++)->n;
B.st[0].n;
C.(*p).n;
D.p=&st.m;
第10题:
设有C语句:struct T{int n;double x;}d,*p;,若要使p指向结构体变量中的成员n,正确的赋值语句是()
第11题:
第12题:
2,3
2,4
3,4
4,6
第13题:
设有以下程序段: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
第14题:
以下对结构体类型变量的定义中,不正确的是( )
A.typedef struct aa { int n; float m; }AA; AA tdl;
B.#define AA struct aa AA{ int n; float m; }tdl;
C.struct { int n; float m; }aa; struct aa tdl;
D.struct { int n; float m, }tdl;
第15题:
设有如下定义:
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;
第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题:
设有以下语句 ( ) 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
第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题:
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
第20题:
以下程序的输出结果是 ( ) 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
第21题:
试题37
有以下程序
#include <stdio.h>
main()
{ struct node {int n; struct node *next; }*p;
struct node x[3]={{2,x+1},{4,x+2},{6,NULL}};
p=x;
printf(“%d,”, p?n);
printf(“%d\n”, p?next?n);
}
程序运行后的输出结果是()
A.2,3
B.2,4
C.3,4
D.4,6
第22题:
若已定义 struct num{ int a; int b; float f; } n={1,3,5.0}; struct num *p=&n; 则表达式p->b/n.a*++p->b的值是 ① ,表达式(*p).a+p->f的值是 ② 。
第23题:
p->n++
(*p).n
++(p->n)
p->n