若有以下定义和语句 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 student { int age; int num;}; struct student stu[3]={{1001,20},{1002,19},{1003,21}}; main() { struct student *p; p=stu; …} 则以下不正确的引用是( )。
A.(p++)->num
B.p++
C.(*p).num
D.P=&stu.age.
第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题:
以下对结构体类型变量的定义中,不正确的是
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;
第4题:
有以下程序: #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
第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.#NAME?
第6题:
以下程序的输出是______。 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
第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题:
若有以下说明和语句:sturct 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
第9题:
以下对结构体类型变量的定义中,不正确的是( )
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;
第10题:
设有如下定义:
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;