网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)

设有一结构体类型变量定义如下: struct date { int year; int month; int day; }; struct worklist { char name[20]; char sex; struct date birthday; } person; 若对结构体变量person的出生年份进行赋值时,下面正确的赋值语句是()。

A.year=1976

B.birthday.year=1976

C.person.birthday.year=1976

D.person.year=1976


参考答案和解析
C
更多 “设有一结构体类型变量定义如下: struct date { int year; int month; int day; }; struct worklist { char name[20]; char sex; struct date birthday; } person; 若对结构体变量person的出生年份进行赋值时,下面正确的赋值语句是()。A.year=1976B.birthday.year=1976C.person.birthday.year=1976D.person.year=1976” 相关考题
考题 设有以下语句typedef struct TT{char c,int a[4];} CIN;则下面叙述中正确的是A) 可以用 TT 定义结构体变量B)TT 是 struct 类型的变量C) 可以用 CIN 定义结构体变量D)CIN 是 struct TT 类型的变量

考题 有以下结构体说明、变量定义和赋值语句struct STD{ char name[10];int age;char sex;} s[5],*ps;ps=s[0];则以下 scanf 函数调用语句中错误引用结构体变量成员的是A)scanf("%s",s[0].name);B)scanf("%d",s[0].age);C)scanf("%c",(ps-sex));D)scanf("%d",ps-age);

考题 设有说明struct DATE { int year;int month; int day;};请写出一条定义语句,该语句定义 d 为上述结构体 类型 变量,并同时为其成员 year 、 month 、 day 依次赋初值 2006 、 10 、 1 : 【 19 】 。

考题 ( 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;

考题 设有说明struct DATE{int year;int month; int day;};请写出一条定义语句,该语句定义d为上述结构体变量,并同时为其成员year、month、day 依次赋初值2006、10、1:_________;

考题 设有定义:struct person{ int ID;char name[12];}p;请将 scanf("%d", 【 1 2 】 ); 语句补充完整,使其能够为结构体变量 p 的成员 ID 正确读入数据。

考题 设有以下语句 typedef struct TT {char c; int a[4];}CIN; 则下面叙述中正确的是______。A.可以用TT定义结构体变量B.TT是struct类型的变量C.可以用CIN定义结构体变量D.CIN是struct TT类型的变量

考题 已知学生记录描述为 struct student { int no; char name[20]; char sex; struct { int year; int month; int day; } birth; }; struct student s;变量s中的“生日”应是“1985年4月4日”,下列对“生日”的正确赋值方式是______。A.year=1985;month=4;day=4;B.birth.year=1985;birth.month=4;birth.day=4;C.s.year=1985;s.month=4;s.day=4;D.s.birth.year=1985;s.birth.month=4;s.birth,day=4;

考题 设有以下说明语句typedef struct{ int n;char ch[8];} PER;则下面叙述中正确的是A.PER 是结构体变量名B.PER是结构体类型名C.typedef struct 是结构体类型D.struct 是结构体类型名

考题 已知学生记录描述为:struct student{ int no;char name[20],sex;struct{ int year,month,day;} birth;};struct student s;设变量s中的"生日"是"1984年11月12日",对"birth"正确赋值的程序段是A.year=1984;month=11;day=12;B.s.year=1984;s.month=11;s.day=12;C.birth.year=1984;birth.month=11;birth.day=12;D.s.birth.year=1984;s.birth.month=11;s.birth.day=12;

考题 下面结构体的定义语句中,不正确的是______。A.structdate { int month; int day; int year; } Struct date datel;B.stmctdate { intmonth; int day; int year; } datel;C.struct { int month; int day; int year; } date 1;D.#define DATE stmct date DATE { int month; int day; int year; }datel;

考题 设有以下语句: typedef struct S { int g; char h; } T; 则下面叙述中正确的是( )。A.可以用S定义结构体变量B.可以用T定义结构体变量C.S是struct类型的变量D.T是stnictS类型的变量

考题 设有以下语句: struct SS { int no; char name[10];}PERSON; 则下面叙述中错误的是 ( )A.struct是结构体类型的关键字B.struct SS是结构体类型C.PERSON是结构体类型名D.name是结构体成员名

考题 设有定义:struct person{int ID;char name[12];}P;请将scanf(“%d”, 【 】);语句补充完整,使其能够为结构体变量P的成员ID正确读人数据。

考题 若定义下列结构体,结构体变量p的出生年份赋值正确的语句是( )。 struct st { int x; int y; int z; } struct worker { char name[20]; char sex; struct st birth; }p;A.x=1987B.birth.x=1987;C.p.birth.x=1987;D.p.x=1987;

考题 设有以下语句typedef struct S{ int g; char h; } T;则下面叙述中正确的是( )A.可用S定义结构体变量B.可以用T定义结构体变量C.S是struct类型的变量D.T是struct S类型的变量

考题 设定义下列结构体,结构体变量p的出生年份赋值正确的语句是( )。Struct st{ int x;inty;int z;}Struct worker{ char name[20];char sex;struct st birth;}p;A.x=1987B.birth.x=1987;C.p.birth.x=1987;D.p.x=1987;

考题 设定义下列结构体,结构体变量p的出生年份赋值正确的语句是( )。 stmct st { int x; int y; int z; } struct worker { char name[20]; char sex; struct st birth; }p;A.x=1987B.birth.x=1987;C.p.birth.x=1987;D.p.x=1987;

考题 若有以下语句:typedef struct S{int 9;char h;}T;以下叙述中正确的是( )。A.可用s定义结构体变量B.可用T定义结构体变量C.S是struct类型的变量D.T是struct S类型的变量

考题 设有以下语句:typedef struct TY{char C;int a{4 1;}CIN;则下面叙述中正确的是( )。A.CIN是struct Tr类型的变量B.TT是struct类型的变量C.可以用,lr定义结构体变量D.可以用CIN定义结构体变量

考题 设有以下说明语句: typedef struct { int n; char ch[8]; }PER; 则下面叙述中,正确的是( )。A.PER是结构体变量名B.PER是结构体类型名C.typedef struct是结构体类型D.struct是结构类型名

考题 设定义下列结构体,结构体变量p的出生年份赋值正确的语句是( )。 struct st { int x; int y; int z; } struct worker { char name[20]; char sex; struct st birth; }p;A.x=1987B.birth.x=1987;C.p.birth.x=1987;D.p.x=1987;

考题 某C语言结构体的定义如下。 struct date { int year, month, day; }; struct worklist { char name[20]; char sex; struct date birthday; }person; 若对变量person的出生年份进行赋值,正确的赋值语句是(33)。A.year=1976B.birthday. year=1976C.person. year=1976D.person. birthday. year=1976

考题 下列关于结构型变量的定义语句中,错误的是( )A.typedef struct CCCB.define GGG struct { char name[20];GGG CCC { char name[20]; int age; int age; }GGG; }; GGG abc ; GGG CCC abc;C.structD.struct { char name[20]; { char name[20]; int age; int age; }ccc; }abc; CCC abc;

考题 下列对结构及其变量定义错误的是( )。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; };

考题 有下列语句:  struct Birthday{public int year;  public int month;   public int day;}; struct Student{ int no;  string name;   int age;  public Birthday bir; };  ……  Student Stu;  如果要把Stu的出生年份赋值为1988,正确的语句是()A、 Stu.bir.year=1988;B、 Stu.year=1988;C、 Stu. Birthday.year=1988;D、 Student. Birthday.year=1988;

考题 数据结构里,struct student { char name[20]; char sex[10]; int age; int score; }; 定义结构体后,定义变量、数组赋值正确的是()。A、struct student s={"张三","男",18,100};B、struct student stu[3]={{"张三","男",18,100},{"李四","男",19,90},{"王五","男",23,97}};C、struct student s={"李四";"女";18;100};D、struct student stu[3]={{"张三",18,"男",100},{"李四",19,"男",90},{"王五",23,"男",97}};

考题 单选题设有以下语句 typedef struct TT {char c;int a[4]} CIN; 则下面叙述中正确的是( )。A CIN是structTT类型的变量B TT是struct类型的变量C 可以用TT定义结构体变量D 可以用CIN定义结构体变量