已知学生记录描述如下,设变量s中的“生日”应是“1984年11月11日”,下列对生日的正确赋值方式是()。 struct student{ int no; char name[20]; char set; struct{ int year; int month; int day; } birth; }; struct student s;A.year=1984;month=11;day=11;B.birth.year=1984; birth.month=11; birth.day=11C.s.year=1984;s.month=11;s.day=11D.s.birth.year=1984;s.birth.month=11; s.birth.day=11;

已知学生记录描述如下,设变量s中的“生日”应是“1984年11月11日”,下列对生日的正确赋值方式是()。 struct student{ int no; char name[20]; char set; struct{ int year; int month; int day; } birth; }; struct student s;

A.year=1984;month=11;day=11;

B.birth.year=1984; birth.month=11; birth.day=11

C.s.year=1984;s.month=11;s.day=11

D.s.birth.year=1984;s.birth.month=11; s.birth.day=11;


参考答案和解析
s.birth.year=1984;s.birth.month=11; s.birth.day=11;

相关考题:

以下结构体类型说明和变量定义中正确的是A)typedef struct{int n; char c;} REC;REC t1,t2;B)struct REC;{int n; char c;};REC t1,t2;C)typedef struct REC ;{int n=0; char c='A';} t1,t2D)struct{int n;char c;}REC;REC t1,t2;

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

已知职工记录描述如下,structworker{intno;charname[20];charsex;struct{intday;intmonth;intyear;}birth;};structworkerw;设变量w中的“生日”是“1993年10月25日”,下列对“生日”的正确赋值方式是() A、day=25;month=10;year=1993;B、w.birth.day=25;w.birth.month=10;w.birth.year=1993;C、w.day=25;w.month=10;w.year=1993;D、birth.day=25;birth.month=10;birth.year=1993;

下列语句段中,正确的是( )。A.struct{int x;float y;int a[2];unsigned b[3];char name[10];};B.struct stu{unsigned a[3];unsigned b[4];}x;int*p=x.a;C.struct stu{int a;float x[4];}y={1,1.0};float data=y.x;D.struct nd{int a,b;unsigned c[2]=5;};

有以下说明和定义语句 struct student { int age;char num[8]; struct student stu[3]={{20,"200401"},{21,"200402"},{19,"200403"}}; struct student *p=stu;}; 以下选项中引用结构体变量成员的表达式错误的是A.(p++)->numB.p->numC.(*p).numD.stu[3].age

已知学生记录描述为 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;

已知学生记录描述为: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;

C数组名称是指针变量吗? 看这段程序,可是执行。#include stdio.hint 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;i3;i++,p++) printf("%-6s %d\n",p-name,p-age);}将其改成这样:#include stdio.hint 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;i3;i++,aa++) printf("%-6s %d\n",aa-name,aa-age);}为什么就执行不了呢

有以下程序includestruct STU{char name[10];int num;};void f(char*name, intnum){s 有以下程序 #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]={{"YangSan",20041},{"LiSiGuo",20042}},*p; p=s[1]; f(p->name,p->num); printf("%s %d\n",p->name,p->num); } 程序运行后的输出结果是A.SunDan 20042B.SunDan 20044C.LiSiGuo 20042D.YangSan 20041

下面结构体的定义语句中,不正确的是______。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;

下列对结构及其变量定义错误的是( )。A.struct My StructB.struct MyStruct{ {int num; int num;char ch; char ch;} }My;C.strutD.struct{ {int num; int num;char ch; char ch;}My; };

有以下程序: include struct STU (char name[10]; int num; }; 有以下程序: #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 20042B.SunDan 20044C.LiSiGuo 20042D.YangSan 20041

有以下定义和语句: 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;

若定义下列结构体,结构体变量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;

设定义下列结构体,结构体变量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;

有如下说明和定义语句: struct student { int age; char num{8};}; struct student stu[3]={{20,"200401"},{21,"200402"),{19,"200403"}}; struct student *p=stu; 以下选项中引用结构体变量成员的表达式错误的是( )。A.(p++)->numB.p->numC.(*p).numD.stu[3].age

设定义下列结构体,结构体变量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;

以下程序的输出结果是______。includestruct stu{int num; char name[10]; int age;};v 以下程序的输出结果是______。#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.ZhangB.ZhaoC.WangD.18

某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; };

在设备驱动程序(函数)Dev_drv1中,对指针ptr的说明如下:【C语文代码】int Dev_drv1(int arg1,int arg2 ){struct node {int ID;char name [20];int range;} ;struct node *ptr;/*其他局部变量声明,略*/ptr = (struct node *)malloc(sizeof(struct node)*100);/*其他程序代码,略*/}设int为32位整数,char占8位。当对指针ptr赋完值后的值为0x3751CO,若再执行一条“ptr++;”语句,此时ptr的值为多少? (用十六进制表示)。

有下列语句:  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}};

单选题有如下程序:#include #include struct S{ char name[10];};void change(struct S *data,int value){ strcpy(data-name, ****); value=13;}main(){ struct S input; int num = 4; strcpy(input.name, THIS); change(input,num); printf(%s,%d,input.name,num);}程序运行后的输出结果是(  )。A****,4B****,13CTHIS,4DTHIS,13

单选题以下scanf函数调用语句中对结构体变量成员的不正确引用的是()。  struct node{      char name[20];      int age;      int sex; }student[5],*p;  p=student;Ascanf(“%s”,student[0].name);Bscanf(“%d”,student[0].age);Cscanf(“%d”,(p-sex));Dscanf(“%d”,p-age);

单选题有如下定义:struct{  int num;  char name[10];  struct {  int y;  int m;  int d; }birth; }s,*ps=s;以下对内嵌结构体成员的引用形式错误的是(  )。Aps.birth.yBs.birth.yCps-birth.yD(*ps).birth.y

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