有以下说明语句:struct Worker{int no;char name[20];};Worker w,*p=&w;则下列错误的引用是()
第1题:
有以下程序: #include <string.h> struct STU (char name[10]; int num; }; void f(char *name, int num) {struct STU s[2]={{"SunDan",20044}.{"Penghua",20045}}; num=s[0].num; strcpy(name,s[0].name); } main() {struct STU s[2]={{"YangSall",20041},{"LiSiGao",20042}},*p;p=&s[1]; f(p->name,p->num); printf("%s%d\n",p->name,p->num); } 程序运行后的输出结果是 ______。
A.SunDan 20042
B.SunDan 20044
C.LiSiGuo 20042
D.YangSan 20041
第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题:
若有以下说明和语句: 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
第4题:
若定义下列结构体,结构体变量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;
第5题:
有如下说明和定义语句: 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
第6题:
设定义下列结构体,结构体变量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;
第7题:
有以下说明和定义语句: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
第8题:
若有一些定义和语句 #include <stdio.h> int a=4, b=3, *p,*q,*w; p=&a; q=&b; w=q; q=NULL; 则以下选项中错误的语句是
A.*q=0;
B.w=p;
C.*p=a;
D.*p=*w;
第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.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;
第11题:
( 38 )有以下定义和语句
struct workers
{ int num;char name[20];char c;
struct
{ int day; int month; int year; } s;
} ;
struct workers w,*pw;
pw = &w;
能给 w 中 year 成员赋 1980 的语句是
A ) *pw.year = 198O;
B ) w.year=1980;
C ) pw->year=1980;
D ) w.s.year=1980;
第12题:
w.no
p->no
(*p).no
*p.no
第13题:
有以下定义和语句: struct students {int num;char name[20];char c; struct {int grade1;int grade2;}s; }; struct students w,*pw; *pw=w; 下列赋值语句不正确的是( )。
A.w.num=1002;
B.w.grade1=85;
C.pw->num=1002;
D.w.s.grade2=85;
第14题:
若有以下定义和语句: #include<stdio.h> int a=4,b=3,*p,*q,*w; p=&a; q=&b; w=q; q=NULL; 则以下选项中错误的语句是( )。
A.*q=0;
B.w=p;
C.*p=a;
D.*p=*w;
第15题:
若有以下定义和语句 int a=4.b=3.* p, * q, * w; p=&a;q=& b; w=q;q=NULL; 则以下选项中错误的语句是
A.*q=0;
B.w=p;
C.*p=a;
D.*p=* w;
第16题:
设定义下列结构体,结构体变量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;
第17题:
若有下列说明和语句,则对结构体变量st中成员i的引用方式不正确的是( )。 Struct stu { int i; int name; }st,*p; p=&st;
A.st.i
B.*p.i
C.(*p).i
D.p->i
第18题:
有以下说明和定义语句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
第19题:
设有如下定义 struct ss { char name [10]; int age; char sex; }std[3],*p=std; 下列各输入语句中错误的是_______。
A.scanf("%d",&(*p).age);
B.scanf("%s",&std.name);
C.scanf("%c",&std[0].sex);
D.scanf("%c",&(p->sex));
第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题:
设有如下定义 struct ss { char name[10]; int age; char sex; }std[3], * p=std; 下面各输入语句中错误的是
A.cin>>(* p).age);
B.cin>>std.name);
C.cin>>std[0].sex);
D.cin>>(p->.sex));
第22题:
有以下程序:#include <stdio.h>#include <strine.h> struct STU { char name[10]; int hum;};void f(char * name,iht num){ struct STU s[2] = {{ "SunDan" ,20044} , {" Penghua" ,20045}}; num= s[0]. nnm; strepy(name,s[0], name);}main( ){ struct STU s[2] = {{"YangSan" ,20041 }, { "LiSiGao" ,20042}}, * P; p = &s[1]; f(p->name,p->hum); printf("% s %d \n" ,p-> name,p->num);}程序运行后的输出结果是( )。
A.SunDan 20042
B.SunDan 20044
C.LiSiGuo 20042
D.YangSan 20041
第23题:
以下scanf函数调用语句中对结构体变量成员的不正确引用的是()。 struct node{ char name[20]; int age; int sex; }student[5],*p; p=student;