更多“单选题设有定义:struct complex{int real,unreal;} data1={1,8},data2;则以下赋值语句中错误的是(  )。A data2=data1;B data2=(2,6);C data2.rea1=data1.rea1;D data2.rea1=data1.unrea1;”相关问题
  • 第1题:

    下面结构体的定义语句中,错误的是( )。 A.struct ord{int x;int Y;int Z;};struet ord a;SXB

    下面结构体的定义语句中,错误的是( )。

    A.struct ord{int x;int Y;int Z;};struet 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;


    正确答案:B
    结构体定义的类型说明的一般形式为:struct结构体标识名{类型名1结构成员名表l;类型名2结构成员名表2;···};。注意:①结构体说明同样要以分号结尾;②紧跟在结构体类型说明之后进行定义;③在说明一个无名结构体类型的同时,直接进行定义;④先说明结构体类型,再单独进行变量定义等。所以B选项错误。

  • 第2题:

    Youcreatedasnapshotofthe/data2filesystemasfollows:fssnap-Fufs-obs=/data2/snap/data2But,thesystemrespondswiththefollowingerror:snapshoterror:InvalidbackingfilepathWhatistheproblem?()

    A.The/datafilesystemdoesnotexist.

    B.Thismessageindicatesthatthe/data2/snapdirectorydoesnotexist.

    C.ThenameoftheBackingStoreisincorrect,itshouldbe/dev/fssnap/0

    D.Thismessageindicatesthatyoucannothavethebackingstorefileonthesamefilesystemasthefilesystembeingsnapped.


    参考答案:D

  • 第3题:

    执行下列程序段后,DATA1单元的值为( ) DATA1 DB 10H,20H DATA2 DB 30H,40H MOV AX,WORD PTR DATA1 CMP AX,WORD PTR DATA2 JA L MOV BX,WORD PTR DATA2 MOV WORD PTR DATA2,AX MOV WORD PTR DATA1,BX L:HLT

    A.40H

    B.30H

    C.20H

    D.10H


    正确答案:B
    解析:在本题中,DATA1中存放的是字节10H,20H。DATA2中存放的是字节30H,40H。执行MOVAX,WORDPTRDATA1后,DATA1的内容转换为字的形式。下一条是把DATA2转换为字后进行比较。JA的作用是两个无符号数比较,高于或不低于不等于转移。在本题中20H30H,所以不转移,继续执行下面的指令,下面的指令的作用是把DATA1的值和DATA2的值换过来,所以DATA1的值是30H。

  • 第4题:

    设有定义:

    则以下赋值语句中错误的是( )。

    A.data2=(2,6);

    B.data2=datal;

    C.data;real=datal.real;

    D.data2.real=datal.unreal;


    正确答案:A
    A)选项中可以在声明变量的同事为data2赋值,但是dala2=(2,6);应写作data2={2,61。所以选择A。

  • 第5题:

    设有定义:

    struct complex

    { int real,unreal;} datal={1,8},data2;

    则以下赋值语句中错误的是

    A.Data2=Data1;

    B.Data2=(2,6);

    C.Data2.Rea1=Data1.Real;

    D.Data2.Real=Datal.unRea


    正确答案:B
    解析:选项B需要强制转换数据类型,应该为(struct complex){2,6};。

  • 第6题:

    指出以下数据定义伪指令所分配的字节数(80386系统)。 (1)DATA1 DF 12,34,56 (2)DATA2 DF DATA2 (3)DATA3 DQ 0,10 DUP(?) (4)DATA4 DT 0,1,2


    正确答案: (1)18字节;
    (3)6字节;
    (3)88字节;
    (4)30字节。

  • 第7题:

    指出以下数据定义伪指令所分配的字节数(8086系统)。 (1)DATA1 DB 10,?,‘A’ (2)DATA2 DW 10 DUP(2,3 DUP(?),1) (3)DATA3 DB ‘HELLO,WORLD!’,‘$’ (4)DATA4 DW DATA4


    正确答案: (1)3字节;
    (2)100字节;
    (3)13字节;
    (4)2字节。

  • 第8题:

    试编写程序,将内部RAM单元中DATA1开始的20个单字节数依次与DATA2单元为起始地址的20个单字节数据进行交换。


    正确答案: >   1  DATA1 EQU #30H
    2  DATA2 EQU #50H
    3  LEN EQU #16
    4  ORG 0H
    0000  7830      5  MOV R0,DATA1
    0002  7950      6  MOV R1,DATA2
    0004  7A10      7  MOV R2,LEN
    0006  E6        8 EXC:// MOV A,@R0
    0007  C7        9  XCH A,@R1
    0008  F6        10  MOV @R0,A
    0009  08        11  INC R0
    000A  09        12  INC R1
    000B  DAF9      13  DJNZ R2,EXC
    14 END

  • 第9题:

    You created a snapshot of the /data2 filesystem as follows:   # fssnap -F ufs -o bs=/data2/snap /data2   But, the system responds with the following error: snapshot error: Invalid backing file path   What is the problem? ()

    • A、 The /data filesystem does not exist.
    • B、 This message indicates that the /data2/snap directory does not exist.
    • C、 The name of the Backing Store is incorrect, it should be /dev/fssnap/0
    • D、 This message indicates that you cannot have the backing store file on the same filesystem as the filesystem being snapped.

    正确答案:D

  • 第10题:

    单选题
    On the development database rac0, there are six raw devices: /dev/raw/raw1 through /dev/raw/raw6. /dev/raw/raw1 and /dev/raw/raw2 are 8GB each, and the rest are 6GB each. An existing disk group +DATA1, of NORMAL REDUNDANCY, uses /dev/raw/raw1 and /dev/raw/raw2.  Which series of the following commands will drop one of the failure groups for +DATA1, create a new disk group +DATA2 using two of the remaining four raw devices, and then cancel the drop operation from +DATA1? ()
    A

    A

    B

    B

    C

    C

    D

    D


    正确答案: B
    解析: 暂无解析

  • 第11题:

    单选题
    You created a snapshot of the /data2 filesystem as follows:   # fssnap -F ufs -o bs=/data2/snap /data2   But, the system responds with the following error: snapshot error: Invalid backing file path   What is the problem? ()
    A

     The /data filesystem does not exist.

    B

     This message indicates that the /data2/snap directory does not exist.

    C

     The name of the Backing Store is incorrect, it should be /dev/fssnap/0

    D

     This message indicates that you cannot have the backing store file on the same filesystem as the filesystem being snapped.


    正确答案: D
    解析: 暂无解析

  • 第12题:

    单选题
    关于字符串比较,下列叙述哪个是正确的()
    A

    比较字符串是否完全相同不能用==

    B

    equals()和equalsIgnoreCase()的作用完全一致

    C

    equalsIgnoreCase()表示如果两个字符串完全相同则返回true,否则返回false

    D

    Stringdate1,date2;则比较二者是否相同的语句是data1=equals(data2);


    正确答案: C
    解析: 暂无解析

  • 第13题:

    设有定义: struet complex {int real,unreal;)datal={1,8},data2; 则以下赋值语句中错误的是( )。

    A.data2=datal;

    B.data2={2,6};

    C.data2.real=datal.real;

    D.data2.real=datal.unreal;


    正确答案:B
    B中的赋值方式仅限于在结构说明时,对每个变量成员初始化。在程序中对结构体成员赋值,或采用选项A中的整体赋值方式,或采用选项C、D中对结构成员依次赋值。

  • 第14题:

    设有定义:则以下赋值语句中错误的是( )。

    A.data2=datal;

    B.data2=(2,6.;

    C.

    D.


    正确答案:B
    选项8需要强制转换数据类型,应该为(structcomplex){2,6};。

  • 第15题:

    设有定义: Struct complex {int real,unreal;}data1={1,8},data2; 则以下赋值语句中错误的是( )。

    A.data2={data1.rea1,data1.unrea1};

    B.data2=(2,6);

    C.data2.rea1=data1->rea1;

    D.data2->rea1=data1.unrea1;


    正确答案:B

  • 第16题:

    设有定义:

    struct complex

    {int real,unreal;}datal={1,8},data2;

    则以下赋值语句中错误的是( )。

    A.data2=(2,6);

    B.data2=datal;

    C.data2.real=datal.real;

    D.data2.real:datal.unreal;


    正确答案:A
    结构体变量建议在定义的时候进行初始化。结构体常见的几种初始化方法如下:计算机内核喜欢用第一种,使用第一种和第二种时。成员初始化顺序可变。因此,可以判断选项A错误。答案为A选项。

  • 第17题:

    阅渎以下说明和C代码,回答问题,将解答写入答题纸的对应栏内。 【说明】函数bubbleSort(int arr [ ] int n, int (*compare)(int, int)的功能是根据调用时传递的比较函数 compare 对数組arr的前n个元素进行排序。 【C代码】

    #define swap(a,b){a=a^b;b=a^b;a=a^b //交换a与b 的值int less(int x, int y){ return((xy)?1: 0);} void bubble Sort(int arr[ ], int n, int (*compare)(int, int)){ int i,j; int swapped= 1; for( i= 0; swapped; 1++) { swapped =0; for(j=0; j
    【问题1】设有如下数组定义:int data1[ ]={4,2.6.3,1};int data2[ ]={4,2,6.3,1}int datas3[ ]={4,2,6.3,1}请分别给出下面的函数调用执行后,数组 data1、data2和 data3 各自的元素序列。(1)bubble Sort(data1, 5, less);(2)bubbleSort(data2, 5, larger)(3)bubbleSort(data3, 3, larger)


    答案:
    解析:
    (1){1,2,3,4,6}(2){6,4,3,2,1}(3){6,4,2,3,1}
    【解析】

    swp 函数是将两元素值进行相互交换。less 数是判断x和y 的关系,如果 xy,则函数值为真; 在)bubbleSort函数中,第二个参数表示进行比素的个数,第三个参数表示进排序的方式,如果传入less函数,则是从小到大排序;如果传入large函数,则是从大到小排序。

  • 第18题:

    关于字符串比较,下列叙述哪个是正确的()

    • A、比较字符串是否完全相同不能用==
    • B、equals()和equalsIgnoreCase()的作用完全一致
    • C、equalsIgnoreCase()表示如果两个字符串完全相同则返回true,否则返回false
    • D、Stringdate1,date2;则比较二者是否相同的语句是data1=equals(data2);

    正确答案:D

  • 第19题:

    试编写一程序,将外部数据区DATA1单元开始的50个单节数逐一依次移动到内部RAM中DATA2单元开始的数据区中。


    正确答案: > MCS51
    1  ORG 0H
    2  DATA1 EQU #1000H
    3  DATA2 EQU #30H
    4  LEN EQU #10H
    0000  901000 5  MOV DPTR,DATA1
    0003  7830      6  MOV R0,DATA2
    0005  7910      7  MOV R1,LEN
    0007  E0        8 LOOP: MOVX A,@DPTR
    0008  F6        9  MOV @R0,A
    0009  A3        10  INC DPTR
    000A  08        11  INC R0
    000B  D9FA      12  DJNZ R1,LOOP
    13 END

  • 第20题:

    下面能够正确打开的一组语句是:()。

    • A、Open“Data1”forInputAs#1Open“Data1”forRandomAs#2
    • B、Open“Data1”forOutputAs#1Open“Data2”forInputAs#1
    • C、Open“Data1”forOutputAs#1Open“Data2”forInputAs#2
    • D、Open“Data1”forInputAs#1Open“Data1”forInputAs#2

    正确答案:C

  • 第21题:

    单选题
    下面能够正确打开的一组语句是:()。
    A

    Open“Data1”forInputAs#1Open“Data1”forRandomAs#2

    B

    Open“Data1”forOutputAs#1Open“Data2”forInputAs#1

    C

    Open“Data1”forOutputAs#1Open“Data2”forInputAs#2

    D

    Open“Data1”forInputAs#1Open“Data1”forInputAs#2


    正确答案: A
    解析: 暂无解析

  • 第22题:

    单选题
    设有定义:struct{int n;float x;}s[2],m[2]={{10,2.8},{0,0.0}};,则以下赋值语句中正确的是(  )。
    A

    s[0]=m[1];

    B

    s=m;

    C

    s.n=m.n;

    D

    s[2].x=m[2].x;


    正确答案: A
    解析:
    定义了结构体类型数组s,长度为2,结构体类型数组m,长度为2,并对数组m进行了初始化。同类型的结构体可以直接用变量名实现赋值,A项正确;数组名为数组首地址,地址常量之间不可以相互赋值,B项错误;数组名为地址常量不是结构体变量,不能引用成员,C项错误;s[2]与m[2]数组越界,D项错误。答案选择A选项。

  • 第23题:

    问答题
    试编写程序,将内部RAM单元中DATA1开始的20个单字节数依次与DATA2单元为起始地址的20个单字节数据进行交换。

    正确答案: >   1  DATA1 EQU #30H
    2  DATA2 EQU #50H
    3  LEN EQU #16
    4  ORG 0H
    0000  7830      5  MOV R0,DATA1
    0002  7950      6  MOV R1,DATA2
    0004  7A10      7  MOV R2,LEN
    0006  E6        8 EXC:// MOV A,@R0
    0007  C7        9  XCH A,@R1
    0008  F6        10  MOV @R0,A
    0009  08        11  INC R0
    000A  09        12  INC R1
    000B  DAF9      13  DJNZ R2,EXC
    14 END
    解析: 暂无解析