有声明union perdata{ int class;char ofice[10];int score;} ;该共用体占据字节数为()
第1题:
有语句定义共用体类型变量: union { int i; char ch; float f; } a,bc; 上面定义的共用体变量a、b、c各占( )字节。
A.4
B.2
C.7
D.1
第2题:
变量a所占的内存字节数是 ______。
A.4
B.5
C.6
D.8 union U { char st[4]; int i; long l; }; Struct A{ int c; union U u; }a;
第3题:
以下程序的输出结果是 #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.10
B.13
C.7
D.8
第4题:
下列程序的执行结果是______。 #include<stdio.h> union { int i; char c[2]; }; void main() { union un x; x.c[0]=10; x.c[1]=1; printf("\n%d",x.i); }
A.266
B.11
C.265
D.138
第5题:
以下程序的输出结果是( ) # 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.10
B.13
C.7
D.8
第6题:
若有下面的说明和定义: 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.34
B.52
C.54
D.64
第7题:
有声明union perdata{ int class;char ofice[10];int score;} ;该共用体占据字节数为()
第8题:
考虑下面的声明: union u1{ char c; int i[3]; double d; }; 那么每个u1的对象需要的字节数为()
第9题:
下面的函数声明中,()是“void BC(int a, int b);”的重载函数
第10题:
下面语句定义了共用体(联合体)变量a,则a占用()个字节。union data { short int i ;char c ; double d;}a;
第11题:
10
12
14
15
第12题:
21
13
12
8
第13题:
变量a所占内存字节数是______。 union U { char st[4]; int i; long 1; }; struct A { int c; union U u; }a;
A.4
B.5
C.6
D.8
第14题:
在下列定义中的共用体所占内存字节数是( )。 union { char k[6]; struct { int m; floar f; }a; double d; }b;
A.8
B.14
C.18
D.10
第15题:
有以下程序: #include <iostream> #include <string> using namespace std; class Y; class X { private: int x; char *strx; public: X(int a, char *str) { x=a; strx=new char[strlen(str)+1]; strcpy(strx,str); } void show(Y &ob) ; }; class Y { private: int y; char *stry; public: Y(int b,char *str) { y=b; stry=new char[strlen(str)+1]; strcpy(stry, str); } friend void X: :show(Y &ob) ; }; void X: :show(Y &ob) { cout<<strx<<", "; cout<<ob, stry<<end1; } int main ( ) { X a(10,"X"); Y b (20, "Y"); a. show(B) ; return 0; } 执行后的输出结果是( )。
A.X,Y
B.a,b
C.X,X
D.Y,Y
第16题:
有以下程序: #include <stdio.h> struct STU { char name[10]; int num; int Score; }; main() { struct STU s[5]={{"YangSan",20041,703},{"LiSiGuo",20042,580}, {"WangYin",20043,680},{"SunDan",20044,550}, {"Penghua",20045,537}}, *p[5],*t; int i,j; for(i=0;i<5;i++) p[i]=&s[i]; for(i=0;i<4;i++) for(j=i+1;j<5;j++) if(p[i]->Score>p[j]->Score) { t=p[i];p[i]=p[j];p[j]=t;} printf("%d%d\n",s[1].Score,p[1]->Score); } 执行后的输出结果是( )。
A.550 550
B.680 680
C.580 550
D.580 680
第17题:
若有如下定义和声明: struct s { int m;char ch;double x; union t {char a[6];int b[3];}tt;}ss; 则sizeof(struets)的值是( )
A.6
B.14
C.17
D.20
第18题:
在16位IBM-PC上使用C语言,如定义下列共用体类型变量: union data { int i; char ch; float f; }a,b,c; 则共用体变量a,b,c占用内存的字节数为( )。
A.1
B.2
C.4
D.6
第19题:
以下程序段的输出结果是()。 union node {int a; float b; Char C[10];}; printf(”%d”,sizeof(union node));
第20题:
Union test{ Char a[3]; Int b[4]; Short c[5]; }; 一个test类型数据占用()个字节的空间。
第21题:
public class Score implements Comparable
第22题:
第23题:
第24题:
int BC(int x, int y);
void BC(int a, char b);
float AA(int a, char b);
int BC(int a, int b=0);