以下对结构体变量stu1成员age的非法引用是 struct student { int num; int age; } stu1,*p; p=&stu1;
A.stu1.age
B.student.age
C.p->age
D.(*p).age
第1题:
下列说法错误的是( )。
A.下列结构体定义时,占据了5个字节的空间 struct student “nt num; int age; char sex; }
B.结构体的成员名可以与程序中的变量名相同
C.对结构体中的成员可以单独使用,它的作用相当于普通变量
D.结构体可以嵌套定义
第2题:
此题为判断题(对,错)。
第3题:
A.__lt__
B.__le__
C.__gt__
D.__ge__
第4题:
下列对结构及其变量定义错误的是( )。
A.struct My Struct
B.struct MyStruct{ {int num; int num;char ch; char ch;} }My;
C.strut
D.struct{ {int num; int num;char ch; char ch;}My; };
第5题:
以下对结构体变量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
第6题:
有以下程序
#include <stdio.h>
struct stu
{ int num; char name [10];int age;};
Void fun(struct stu *p)
{ printf("%s\n,p->name);}
main( )
{ struct stu x[3]={ {01,”Zhang”,20},{02, ” Wang”,19},{03, ”zhao”,18} };
fun(x+2);
}
程序运行后的输出结果是
A)Zhang
B)Zhao
C)Wang
D)19
第7题:
有以下说明和定义语句struct student{ int age; char num[8];};struct student stu[3]={{20,"200401"},{21,"200402"},{10\9,"200403"}};struct student *p=stu;以下选项中引用结构体变量成员的表达式错误的是A.(p++)->num B.p->num C.(*p).num D.stu[3].age
第8题:
下列说法不正确的是( )
A.下列结构体定义时,占据了5个字节的空间 struct s {int num; int age; char sex; }
B.结构体的成员名可以与程序中的变量名相同
C.对结构体中的成员可以单独使用,它的作用相当于普通变量
D.结构体的成员可以是一个结构体变量
第9题:
以下scanf函数调用语句中对结构体变量成员的不正确引用是 struct pupil { char name[20]; int age int sex; } pup[5],*p; p=pup;
A.scanf("%s",pup[0].name);
B.scanf("%d",&pup[0].age);
C.scanf("%dT",&(p->sex));
D.scanf("%d",p->age);
第10题:
下列对结构及其变量定义错误的是( )。
A.struct My Struct { int num; char ch; }
B.struct MyStruct { int num; char ch; }My;
C.strut { int num; char ch; }My;
D.struct { int num; char ch; };
第11题:
有以下说明语句:struct Student{int num;double score;};Student stu[3]={{1001,80},{1002,75},{1003,91}},*p=stu;则下面引用形式错误的是()
第12题:
Zhang
Zhao
Wang
19
第13题:
看这段程序,可是执行。#include <stdio.h>int main(int argc, char *argv[]){ struct info { char name[33]; int age; }; struct info aa[3]={"meng",20,"juan",29,"an",59}; struct info *p=aa; for(int i=0;i<3;i++,p++) printf("%-6s %d\n",p->name,p->age);}将其改成这样:#include <stdio.h>int main(int argc, char *argv[]){ struct info { char name[33]; int age; }; struct info aa[3]={"meng",20,"juan",29,"an",59}; //struct info *p=aa; for(int i=0;i<3;i++,aa++) printf("%-6s %d\n",aa->name,aa->age);}为什么就执行不了呢
第14题:
有以下程序:
#include<
struct stu { int num;char name[10];int age;}
void fun(struct stu*p)
{ printf("%s\n",(*p).name);}
main
{ struct stu students[3]={{9801,"Zhang".20}, {9802,"Wang",19},{9803,"Zhao",1 8}}
fun(students+2); }
输出的结果是( )。
A.Zhang
B.Zhao
C.Wang
D.18
第15题:
若有以下定义的语句: 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.
第16题:
下列说法错误的是( )。
A.下列结构体定义时,占据了5个字节的空间 struct student {int num; int age; char sex; }
B.结构体的成员名可以与程序中的变量名相同
C.对结构体中的成员可以单独使用,它的作用相当于普通变量
D.结构体可以嵌套定义
第17题:
若有结构体定义:
struct stu{int num;
char sex;
int age;
}al,a2;
则下列语句中错误的是( )。
A.printf("%d,%C,%d",a1);
B.a2.age=a1.age;
C.a1.age++;
D.a1.num=5;
第18题:
有如下说明和定义语句: 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
第19题:
有以下说明和定义语句:struct student{int age; char num[8] ;};struct student stu [3] = { { 20, "200401" } , {21, "200402" } , {19, "200403" } };stract student * p = stu;以下选项中引用结构体变量成员的表达错误的是( )。
A.(p++) ->num
B.p- >num
C.( *p).num
D.stu[3].age
第20题:
以下程序的输出结果是______。#include<stdio.h>struct stu{ int num; char name[10]; int age;};void fun(struct stu*p){ printf("%s\n",(*p).name);}main(){ struct stu students[3]={ {9801,"Zhang",20}, { 9802,"Wang",19}, { 9803,"Zhao",18} }; fun(students+2);}
A.Zhang
B.Zhao
C.Wang
D.18
第21题:
下列关于结构型变量的定义语句中,错误的是( )
A.typedef struct CCC
B.define GGG struct { char name[20];GGG CCC { char name[20]; int age; int age; }GGG; }; GGG abc ; GGG CCC abc;
C.struct
D.struct { char name[20]; { char name[20]; int age; int age; }ccc; }abc; CCC abc;
第22题:
若有以下说明和语句: struct student{ int age; int num; }std, *p; p=&std; 则下面对该结构体变量std中成员age的引用方式错误的是()。
第23题:
std.age
*p.age
(*p).age
p->age
第24题:
scanf(“%s”,student[0].name);
scanf(“%d”,&student[0].age);
scanf(“%d”,&(p->sex));
scanf(“%d”,p->age);