在VC++6.0环境下,sizeof(int)和sizeof(float)的值分别为()
第1题:
● 已知有变量 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)

第2题:
假设在turboc2.0采用small模式编译如下程序 main() { char a[4]={'a','b'}; char *b="abc"; printf("%d,%d",sizeof(A) ,sizeof(B) ); } 其输出结果为_____。
A.4,2
B.4,4
C.4,3
D.2,2
第3题:
设int a[4];int *p=a,则sizeof (p)和sizeof (a)的值分别是______ 。
A.4和4
B.16和4
C.16和16
D.4和16
第4题:
设有结构体类型定义: struct try { int one; float two; }*str;若要动态开辟一个结构单元,使指针str指向其首地址,正确的语句是______。
A.str=(try*)malloc(sizeof(try));
B.*str=(struct try*)malloc(sizeof(struct try));
C.str=(strucy try*)malloc(sizeof(struct try));
D.str=(struc try)malloc(sizeof(struct try));
第5题:
char str[ ]= "Hello";
char *p=str;
int n=10;
sizeof(str)=( )
sizeof(p)=( )
sizeof(n)=( )
void func(char str[100])
{ }
sizeof(str)=( )
第6题:
有以下定义和语句,则sizeof(a.share)的值是( )。
struct date
{ unsigned int day;
unsigned int mouth;
unsigned int year;
union{int share1;
float share2;
}share;
}a;
第7题:
以下为 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 ) =
第8题:
有以下程序
#include<stdio.h>
main( )
{int s,t,A=10 ouble B=6;
s=sizeof(A);t=sizeof(B);
printf(”%d,%d\n”,s,t);
}
在VC6平台上编译运行,程序运行后的输出结果是( )。
A.2,4
B.1,4
C.4,8
D.10,6
第9题:
第10题:
若指针p已正确定义,要使p指向两个连续的整型动态存储单元,不正确的语句是()。
第11题:
4,8
4,4
2,4
10,6
第12题:
3,4
4,4
4,8
10,6
第13题:
若有下面的说明和定义
struct test
{ int ml; char m2; float m3;
union uu {char ul[5]; int u2[2];} ua;
} myaa;
则sizeof(struct test )的值是
A.12
B.16
C.14
D.9
第14题:
在C++中,下列程序段的输出结果是【 】。
int x, a[10];
cout<<sizeof(x)<<“”<<sizeof(a)<<“”<<sizeof(float)<<end1
第15题:
若指针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));
第16题:
WIN32 平台下,sizeof(short) = ____,sizeof(int) = ____,sizeof(long) = ____。
第17题:
有以下定义和语句,则sizeof(a) 的值是【 】,而sizeof(a,share)的值是【 】
struct date
{ int day;
int mouth;
int year;
union{int share1;
float share2;
}share;
}a;
第18题:
下列x的值是int x;x= sizeof 2.25*4;
第19题:
经下列语句定义后,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,4
B.1,2,2,4
C.1,4,2,8
D.2,4,2,8
第20题:
若有下面的说明和定义: struct test { int m1; char m2; float m3; union uu {char ul[5]; int u2[2];} ua; }myaa;则sizeof(struct test)的值是( )。
A.12
B.16
C.14
D.9
第21题:
以下程序段的输出结果是()。 struct node {int a; float b; char c[10];} printf(“%d”,sizeof(struet node)) ;
第22题:
第23题:
4,4,4
1,4,8
0,0,0
1,2,4