已知某C语言程序中数组R定义如下: struct record{ char id; int num ; } ; struct record R[4]={{1,0x11},{2,0x22},{3,0x33},{4,0x44}}; 执行该程序时,给数组R分配的存储空间为()A.8个字节B.20个字节C.32个字节D.60个字节

已知某C语言程序中数组R定义如下: struct record{ char id; int num ; } ; struct record R[4]={{1,0x11},{2,0x22},{3,0x33},{4,0x44}}; 执行该程序时,给数组R分配的存储空间为()

A.8个字节

B.20个字节

C.32个字节

D.60个字节


参考答案和解析
不会提示编译错误,程序可以运行

相关考题:

下面结构体的定义语句中,错误的是A)struct ord {int x;int y;int z;}; struct ord a;B)struct ord {int x;int y;int z;} struct ord a;C)struct ord {int x;int y;int z;} a;D)struct {int x;int y;int z;} a;

下列语句段中,正确的是( )。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 stu{int num;charname[20];}x[5]={1,"LI",2,"ZHAO",3,"WANG",4,"ZHANG",5,"LIU"};for(i=1;i<5;i++)printf("%d%C",x[i].num,x[i]name[2]);以上程序段的输出结果为( )。A.2A3N4A5UB.112A3H41C.1A2N3A4UD.2H3A4H51

定义结构体数组:struct stu{ int num;char name[20];}x[5]={1,"LI",2,"ZHAO",3,"WANG",4,"ZHANG",5,"LIU"};for(i=1;i<5;i++)printf("%d%c",x[i].num,x[i].name[2];以上程序段的输出结果为( )。A.2A3N4A5UB.112A3H41C.1A2N3A4UD.2H3A4H51

有以下程序#includestruct NODE{ int num; struct NODE *next; };main(){ struct NODE *p,*q,*r;p=(struct NODE*)malloc(sizeof(struct NODE));q=(struct NODE*)malloc(sizeof(struct NODE));r=(struct NODE*)malloc(sizeof(struct NODE));p-num=10; q-num=20; r-num=30;p-next=q;q-next=r;printf("%d\n ",p-num+q-next-num);}程序运行后的输出结果是A.10B.20C.30D.40

LDRR0,0x22/LDRR1,0x11/SUBR0,R0,R1/CMPR0,R1/执行这段程序后,R0的值为:() A A0x22B B0x33C C0x11D D0

有以下程序 include typedef struct { int num;double s; }REC; void funl(REC *x) { x 有以下程序 include<stdio.h> typedef struct { int num;double s; }REC; void funl(REC *x) { x->num=23;x->s=88.5; } void main() { REC a={16,90.0}; fun1(A); printf("%d\n",a.num); } 程序运行后的输出结果是( )。

定义结构体数组: struct stu { int num; char name[20]; }x[5];{1,"L1",2,"ZHAO",3,"WANG",4,"ZHANG",5,"LIU"}; for(i=1;i<5;i++) printf("%d%c",x[i].num,x[i].name[2]); 以上程序段的输出结果为( )。A.2A3N4A5UB.1I2A3H4IC.1A2N3A4UD.2H3A4H5I

有以下程序: inClude structNODE{ int num; structNODE*next; }; main() {StructN00E 有以下程序:#inClude <stdlib.h>struct NODE{int num;struct NODE *next;};main(){ Struct N00E *p,*q,*r;int sum;0;p=(struct NODE *)malloc(sizeof(struct NODE));q=(struct NODE *)malloc(sizeof(struct NODE));r=(struct NODE *)malloc(Sizeof(struct NODE));p->num=1;q->num=2;r->num=3;p->next=q;q->next=r;r->next=NULL;sum+=q->next->num;sum+=p->num;printf("%d\n",sum);}执行后的输出结果是A.3B.4C.5D.6

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

设某程序中定义了全局整型变量x和r,且函数f()的定义如下所示,则在语句“x= r*r+1”中(49)。 int f(int r){ int x; X= r*r+1 ; return x; }A.x和r均是全局变量B.x是全局变量、r是形式参数C.x是局部变量、r是形式参数D.x是局部变量、r是全局变量

有以下程序 include struct NODE {int num;stmct NODE*next;}; main() { struct NODE 有以下程序#include<stdlib.h>struct NODE{ int num;stmct NODE*next;};main(){ struct NODE*p,*q,*r;p=(struct NODE*)malloc(sizeof(struct NODE));q=(struct NODE*)malloc(sizeof(struct NODE));r=(struct NODE*)malloc(sizeof(struct NODE));p->num=10;q->num=20;r->num=30;p->next=q;q->next=r;printf(“%d\n”,p->num+q->next->num);}程序运行后的输出结果是A.10B.20C.30D.40

有以下程序: include struct NODE{ int num; struct NODE*next; } main() {structNOD 有以下程序:#include<stdlib.h>struct NODE{int num;struct NODE *next;}main(){ struct NODE *p,*q,*r;int sum=0;p=(struct NODE *)malloc(sizeof(struct NODE));q=(Struct NODE *)malloc(sizeof(struct NODE));r=(Struct NODE *)malloc(sizeof(struct NODE));p->num=1; q->num=2; r->num=3;p->next=q; q->next=r; r->next=NULL;sum+=q->next->num;sum+=p->num;printf("%d\n",sum);}执行后的输出结果是( )。A.3B.4C.5D.6

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

有以下程序 include struct NODE{ int num; struct NODE *next;}; main( ) 有以下程序#include <stdlib.h>struct NODE{int num;struct NODE *next;};main( ){ struct NODE *p,*q,*r;int sum=0;p=(struct NODE *)malloc(sizeof(struct NODE));q=(struct NODE *)malloc(sizeof(struct NODE));r=(struct NODE *)malloc(sizeof(struct NODE));p->num=1;q->num=2;r->num=3;p->next=q;q->next=r;r->next=NULL;sum+=q->next->num;sum+=p->num;printf(“%d\n”,sum);}执行后的输出结果是A.3B.4C.5D.6

设定义下列结构体,结构体变量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 stu { int num; char name[20]; }x[5]={1,"ZHAO",2,"QIAN",3,"SUN",4,"LEE",5,"ZHOU"}; for(i=1;i<5;i++) printf("%d%c",x[i].num,x[i].name[2]); 程序执行后的输出结果是( )。A.2A3N4E5OB.1H2I3U4EC.1A2N3E4OD.1A2N3E4O

有如下程序段#include "stdio.h"typedef union{ long x[2]; int y[4]; char z[8];}atx;typedef struct aa { long x[2]; int y[4]; char z[8];} stx;main(){ printf("union=%d,struct aa=%d\n",sizeof(atx),sizeof(stx));}则程序执行后输出的结果是A.union=8,struct aa=8 B.union=8,struct aa=24C.union=24,struct aa=8 D.union=24,struct aa=24

有以下程序: include struct NODE { int num; struct NODE*next; }; main() { struct 有以下程序:#include <stdlib.h>struct NODE{ int num; struct NODE *next; };main(){ struct NODE *p,*q,*r;p=(struct NODE*)malloc(sizeof(struct NODE));q=(struct NODE*)mallloc(sizeof(struct NODE));r=(struct NODE*)malloc(sizeof(struct NODE));p->num=10;q->num=20; r->num=30;p->next=q;q->next=r;printf("%d\n",p->num+q->next->num);}程序运行后的输出结果是( )。A.10B.20C.30D.40

有以下程序 include gtruet NODE {intnum;struct NODE *next;}; main() {struct NODE 有以下程序#include <stdlib.h>gtruet NODE{ int num; struct NODE *next; };main(){struct NODE *p,*q,*r;p=(struct NODE*)malloc(sizeof (struct NODE));q=(struct NODE*)malloc(sizeof (struct NODE));r=(struct NODE*)malloc(sizeef (struct NODE));p->num=10; q->num=20; r->num=30;p->next=q; q->next-r;printf("%d\n",p->num+q->next->num);}程序运行后的输出结果是A.10B.20C.30D.50

有以下程序: include struct NODE {int num;stmct NODE *next;}; main( ) { str 有以下程序:#include<stdlib.h>struct NODE{ int num;stmct NODE *next;};main( ){ struct NODE * p, * q,* r;p=(struct NODE * )malloc(sizeof(struct NODE) );q=(struct NODE * )malloc(sizeof(struct NODE) );r=(struct NODE * )malloc(sizeof(struct NODE) );p->num=10; q->num=20; r->num=30;p->next=q; q->next=r;printf("%d\n",p->num+q->next->num);}程序运行后的输出结果是A.10B.20C.30D.40

有以下程序 include struct NODE {int num;struct NODE*next;} main() {struct NODE 有以下程序#include<stdlib.h>struct NODE{int num;struct NODE*next;}main(){struct NODE *P,*q,*r;p=(struct NODE *)malloc(sizeof(struct NODE));q=(struct NODE *)malloc(sizeof(struet NODE));r=(struct NODE*)malloc(sizeof(struct NODE)):p->num=10;q->num=20;r->num=30;p->next=q;q->next=r;printf("%d\n",p->num+q->next->num):}程序运行后的输出结果是( )A.10B.20C.30D.40

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

有以下程序 inGlude struct NODE { int num; struct NODE *next; } main() {struct N 有以下程序#inGlude<stdlib.h>struct NODE {int num;struct NODE *next;}main(){ struct NODE *p,*q,*r;int sum=0;p=(struct NODE*)malloc(sizeof(struct NODE));q=(struct NODE*)malloc(sizeof(struct NODE));r=(stnlct NODE*)malloc(sizeof(struct NODE));p->num=1;q->num=2;r->num=3;p->next=q;q->next;r;r->next=NULL;sum+=q->next->Num,sum+=p->num;printf("%d\n",sum);}执行后输出结果是A.3B.4C.5D.6

有以下程序: include struct NODE{int nurn;struct NODE *next; }; main() { struct 有以下程序:#include <stdlib.h>struct NODE{int nurn;struct NODE *next;};main(){ struct NODE *p,*q,*r;int sum=0;P=(struct NODE*)malloc(sizeof(struct NODE));q=(struct NODE*)malloc(sizeof(struct NODE));r=(struct NODE*)malloc(sizeof(struct NODE));p->num=1;q->num=2;r->num=3;p->next=q;q->next=r;r->next=NULL;sum+=q->next->num;sum+=p->num;Printf("%d\n",sum);}执行后的输出结果是( )。A.3B.4C.5D.6

阅读下列程序,回答问题: LDR R0, 0x22 LDR R1, 0x11 SUB R0, R0, R1 CMP R0, R1执行这段程序后,R0的值为()A、 0x22B、 0x33C、 0x11D、 0

单选题阅读下列程序,回答问题: LDR R0, 0x22 LDR R1, 0x11 SUB R0, R0, R1 CMP R0, R1执行这段程序后,R0的值为()A 0x22B 0x33C 0x11D 0

单选题有如下定义:struct st{ int a; float b;}x[10];FILE *fp;若文件已正确打开,且数组x的10个元素均已赋值,以下将数组元素写到文件中的语句错误的是(  )。Afor(i=0; i10; i++) fwrite(x,sizeof(struct st), 1,fp);Bfwrite(x,10*sizeof(struct st), 1,fp);Cfwrite(x,sizeof(struct st), 10,fp);Dfor(i=0; i10; i++) fwrite(x[i],sizeof(struct st), 1,fp);