【单选题】设有以下说明和定义: typedef union{ long i; int k[5]; char c; }DATE; struct date{ int cat; DATE cow; double dog; }too; DATE max; 则下列语句的执行结果是 。 printf ("%dn",sizeof(struct date)+sizeof(max));A.26B.30C.18D.8
【单选题】设有以下说明和定义: typedef union{ long i; int k[5]; char c; }DATE; struct date{ int cat; DATE cow; double dog; }too; DATE max; 则下列语句的执行结果是 。 printf ("%dn",sizeof(struct date)+sizeof(max));
A.26
B.30
C.18
D.8
参考答案和解析
B 用typedef说明的类型不是必须用大写,而是习惯上用大写。
相关考题:
下列程序的运行结果是()。 include main() {stmct date {int year,month,day; }today; 下列程序的运行结果是( )。#include<stdio.h>main(){stmct date{int year,month,day;}today;primf("%d\n",sizeof(struct date));}A.8B.6C.10D.12
设有以下定义或语句,则输出的结果是(用small模式编译,指针变量占2个字节) ( ) struct date { long * cat; struct date *next; double dog;} too; printf("%d",sixeof(too));A.20B.16C.14D.12
以下程序的运行结果是#include "stdio.h"main(){struct date{int year,month,day;}today;printf("%d\n",sizeof(struct date));}A.6B.8C.10D.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;
下列程序的输出结果是()。includemain(){struct st{int y,x,z;};union{long i; int j; 下列程序的输出结果是( )。 #include<stdio.h> main() { struct st { int y,x,z; }; union { long i; int j; char k; }un; printf("%d,%d\n",sizeof(struct st),sizeof(un)); }A.6,2B.6,4C.8,4D.8,6
设有以下说明和定义:typedef union {long i; int k[5]; char c;} DATE;struct data { int cat; DATE cow; double dog;} too;DATE max;则语句 printf("%d",sizeof(struct date)+sizeof(max));的执行结果是:___52____
设有以下定义和语句,输出的结果是(用small模式编译,指针变量占2个字节)______。 struct date { long*cat; struct date *next; double dog; }too; printf("%d",sizeof(too));A.20B.16C.14D.12
下列程序的输出结果是( )。 include main() { struct st { int y,x,z; }; union {long 下列程序的输出结果是( )。 #include <stdio.h> main() { struct st { int y,x,z; }; union { long i; int j; char k; } un; printf("%d,%d\n",sizeof(struct st),sizeof(un)); }A.6, 2B.6, 4C.8, 4D.8, 6
有以下程序#include "stdio.h"main(){ struct date { int number; float fenzhi; char name; }stu; printf("%d\n",sizeof(stu));} 程序的运行结果是A.3 B.5C.7 D.8
有以下程序#include "stdio.h"main(){ struct date {int year,month,day;}today; printf("%d\n",sizeof(struct date));}程序的运行结果是A.6 B.8C.12 D.10
设有以下说明和定义:includeVoid main() {typedef union{long i; int k[5]; char 设有以下说明和定义:#include<iostream. h>Void main() {typedef union{long i; int k[5]; char c;}DATE;struct date{iNt cat; DATE cow; double. dog;}too;DATE max;则下列语句的执行结果是( )。cout<<(sizeof(struct date)+sizeof(max))<<end1;}A.26B.52C.18D.8
下列程序的运行结果为( )。 #includestdio.h main { struct date {int year,month,day; }today; printf("%d\n",sizeof(struct date)); }A.8B.6C.10D.12
下列程序的运行结果为()。include main(){stmct date {int year,month,day; }today; pr 下列程序的运行结果为( )。 #include <stdio.h> main() { stmct date {int year,month,day; }today; printf("%d\n",sizeof(struct date)); }A.8B.6C.10D.12
下列程序的运行结果为( )。#includestdio.hmain{ struct date{int year,month,day;}today;printf(%d\n,sizeof(struct date));}A.8B.6C.10D.12
有以下定义和语句,则sizeof(a) 的值是【 】,而sizeof(a,share)的值是【 】struct date{ int day;int mouth;int year;union{int share1;float share2;}share;}a;
有以下定义和语句,则sizeof(a.share)的值是( )。struct date{ unsigned int day;unsigned int mouth;unsigned int year;union{int share1;float share2;}share;}a;
有如下程序段#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
设有以下说明和定义:includeVoid main() {typedef union{long i; int k[5]; char 设有以下说明和定义: #include<iostream. h> Void main() { typedef union { long i; int k[5]; char c; } DATE; struct date {int cat; DATE cow; double dog; }too; DATE max; cout<<(sizeof(struct date)+sizeof(max))<<end1;}A.26B.52C.18D.8
设有以下说明和定义:typedef union{ long i;int k[5];char c; } DATE;struct date{ int cat;DATE cow;double dog; }too;DATE max;则下列语句的执行结果是______。printf("%d",sizeof (struct date) +sizeof(max));A.26B.30C.18D.8
设有以下定义或语句,则输出的结果是(用small模式编译,指针变量占2个字节) struct date { long * cat; struct date * next; double dog; { too; printf(" % d",sizeof(too));A.20B.16C.14D.12
设有以下定义: typedef union {long i;int k[5];char c,}DATE, struct date {int cat;DATE cow;double dog;}too; DATE max; 则下列语句的执行结果是( ) printf("%d",stzeof(struct date)+sizeof(max));A.25B.30C.18D.8
设有以下定义: typedef union { longi; int k[5];char c;}DATE; srtuct date { int cat;DATEcow;double dog;} too; DATE max; 则下语句的执行结果是 ( ) printf("%d,"sizeof(struct date))+size of(max));A.25B.30C.18D.8
下列程序的运行结果为()。includemain(){struct date {int year,month,day; }today; pr 下列程序的运行结果为( )。 #include<stdio.h> main() { struct date {int year,month,day; }today; printf("%d\n",sizeof(struct date)); }A.8B.6C.10D.12
以下程序的输出结果是includemain(){ union un{ int i;long k;char c;};struct byte{i 以下程序的输出结果是 #include<stdio.h> main() { union un{ int i; long k; char c;}; struct byte{ int a; long b; union un c;}r; printf("%d\n",sizeof(r));}A.10B.13C.7D.8
以下程序的输出结果是______。 struct date { long *a; struct date*next; double b; }too; printf("%d",sizeof(too));A.20B.16C.14D.12
以下程序的输出结果是() includemain(){ union un{int i; long k; char c;};struct by 以下程序的输出结果是( ) # include<stdio.h> main() { union un{int i; long k; char c; }; struct byte{ int a; long b; union un c; } r; printf("%d\n",sizeof(r)); }A.10B.13C.7D.8
设有以下说明和定义: typedef union {long i int k[5];char c;}DATE; struct date {int cat;DATE cow;double dog;}too; DATE max; 则下列语句的执行结果是 ( ) printf("%d",sizeof(struet date)+sizeof(max));A.26B.30C.18D.8
以下程序的运行结果是()。includemain(){st,uct date {int year,month,day;}today; pri 以下程序的运行结果是( )。 #include <stdio.h> main() { st,uct date {int year,month,day;}today; printf("%d\n",sizeof(struct date)); }A.6B.8C.10D.12