在VC编译系统中,经下列语句“char x=65;float y=7.3;int a=100;double b=4.5;”定义后,sizeof(x),sizeof(y),sizeof(a),sizeof(b)的值分别是()A.2,2,2,4B.1,2,2,4C.1,4,4,8D.2,4,4,8

在VC编译系统中,经下列语句“char x=65;float y=7.3;int a=100;double b=4.5;”定义后,sizeof(x),sizeof(y),sizeof(a),sizeof(b)的值分别是()

A.2,2,2,4

B.1,2,2,4

C.1,4,4,8

D.2,4,4,8


参考答案和解析
C

相关考题:

设有定义: char p[]={'1', '2', '3'},*q=p; , 以下不能计算出一个 char 型数据所占字节数的表达式是A ) sizeof(p)B)sizeof(char)C) sizeof(*q)D)sizeof(p[0])

下列x的值是 【7】 。int x;x=sizeof 2.25*4;

已知如下定义,则sizeof(a)的值是struct{int i;char c;double a; } a;A.8B.9C.10D.11

已知有变量datal定义如下: union data { int i; char ch; float f; }datal; 则变量datal所占的内存存储空间可表示为(57)。A.sizeof(int)B.sizeof(char)C.sizeof(float)D.SiZCOf(mt)+sizeof(char)+sizeof(float)

已知: union { int i; char c; float a; }st;则sizeof(st)的值是______。A.4B.5C.6D.7

下面程序的输m结果是( )。 typedef union {double x[3]; int y[4]; char z[10]; }M; M t; main() { Printf("%d\n",sizeof(t));}A.32B.26C.24D.4

● 已知有变量 data1 定义如下:union data{ int i;char ch;float f;} data1;则变量 data1 所占的内存存储空间可表示为 (57) 。(57)A. sizeof(int)B. sizeof(char)C. sizeof(float)D. sizeof(int)+sizeof(char)+sizeof(float)

在C++中,下列程序段的输出结果是【 】。int x, a[10];cout<<sizeof(x)<<“”<<sizeof(a)<<“”<<sizeof(float)<<end1

下列程序的输出结果是( )。 #includestdio.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

下列程序的输出结果是()。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

下列程序的输出结果是()。 include main() {stmct st {int y,x,z; }; union {long i; i 下列程序的输出结果是( )。#include<stdio.h>main(){ stmct st{ int y,x,z;};union{ long i;int j;char k;}un;printf("%d,%d\n",sizeof(stmct 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____

若指针p已正确定义,要使p指向两个连续的整型动态存储单元,则正确语句是( )A.p=2 *(int *)malloc(sizeof(int));B.p=(int*)calloc(2*sizeof(int));C.p=(int*)malloc(2* sizeof(int));D.p=2 *(int*)calloc(sizeof(int));

char str[ ]= "Hello";char *p=str;int n=10;sizeof(str)=( )sizeof(p)=( )sizeof(n)=( )void func(char str[100]){ }sizeof(str)=( )

有以下定义和语句,则sizeof(a) 的值是【 】,而sizeof(a,share)的值是【 】struct date{ int day;int mouth;int year;union{int share1;float share2;}share;}a;

设有以下说明和定义: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

下列x的值是int x;x= sizeof 2.25*4;

以下为 Windows NT 下的 32位 C++程序,请计算 sizeof的值char str[] = “Hello” ; char *p = str ;int n = 10;请计算 sizeof (str )= sizeof ( p ) = sizeof ( n ) = void Func (char str[100]){请计算 sizeof( str ) = }void *p = malloc( 100 );请计算 sizeof ( p ) =

x86,win32,vc++6,默认属性的控制台工程:class C1{public:virtual int sum(int i1, int i2){return (i1 + i2);}private:double m_var1;char m_var2;};char sz[] = "abcd";问题:sizeof(C1) = ?sizeof(sz) = ?

经下列语句定义后,sizeof(x)、sizeof(y)、sizeof(a)、sizeof(b)在IBM-PC机上的值分别为______。char x=65;float y=7.3;int a=100;double b=4.5;A.2,2,2,4B.1,2,2,4C.1,4,2,8D.2,4,2,8

有以下程序,程序运行的结果是 ______。includeincludevoid main(){charx 有以下程序,程序运行的结果是 ______。 #include<iostream.h> #include<string.h> void main(){ char x[]= "C++" ,y[10]= "C++" ; cout<<sizeof(x)/sizeof(char)<<“,”<<sizeof(y)/sizeof(char); }A.3 3B.4 4C.4 10D.10 10

若有如下定义和声明: struct s { int m;char ch;double x; union t {char a[6];int b[3];}tt;}ss; 则sizeof(struets)的值是( )A.6B.14C.17D.20

若有下面的说明和定义: union un { char s[10]; long d[3]; }ua; struet std { char c[10];double d;int a; union un vb; }a;则printf("%d\n", sizeof(struct std)+sizeof(union un));输出的值为______。A.34B.52C.54D.64

变量W_data定义如下:union data_node{float ff'int n;char ch;}W_data;则变量W_data所占的内存存储空间可表示为______。A.sizeof(int)B.sizeof(char)C.sizeof(float)D.sizeof(int)+sizeof(char)+sizeof(float)

设已定义浮点型变量data,以二进制代码方式把data的值写入输出文件流对象outfile中,正确的语句是()A、outfile.write((double*)data,sizeof(double));B、outfile.write((double*)data,data);C、outfile.write((char*)data,sizeof(double));D、outfile.write((char*)data,data);

在VC++6.0环境下,sizeof(int)和sizeof(float)的值分别为()A、2,2B、2,4C、4,4D、4,8

单选题设已定义浮点型变量data,以二进制代码方式把data的值写入输出文件流对象outfile中,正确的语句是()Aoutfile.write((double*)data,sizeof(double));Boutfile.write((double*)data,data);Coutfile.write((char*)data,sizeof(double));Doutfile.write((char*)data,data);

单选题有如下定义: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);