下面语句中是堆桔段定义的语句是()。A、CODE SEGMENTB、DATA SEGMENTC、STACK SEGMENT ‘STACK’D、MAIN PROC FAR

下面语句中是堆桔段定义的语句是()。

  • A、CODE SEGMENT
  • B、DATA SEGMENT
  • C、STACK SEGMENT ‘STACK’
  • D、MAIN PROC FAR

相关考题:

●The principle for a stack memory to store data is (72) .(72) A.FIFOB.randomC.FILOD.other way

使用VC6打开考生文件夹下的工程test34_3。此工程包含一个test34_3.cpp,其中定义了表示栈的类stack。源程序中stack类的定义并不完整,请按要求完成下列操作,将程序补充完整。(1)定义类stack的私有数据成员sp和size,它们分别为整型的指针和变量,其中sP指向存放栈的数据元素的数组,size为栈中存放最后一个元素的下标值。请在注释“//**1**”之后添加适当的语句。(2)完成类stack的构造函数,该函数首先从动态存储空间分配含有100个元素的int型数组,并把该数组的首元素地址赋给指针sp,然后将该数组的所有元素赋值为0,并将size赋值为-1(size等于-1表示栈为空)。请在注释“//**2**”之后添加适当的语句。(3)完成类stack的成员函数push的定义。该函数将传入的整型参数x压入栈中,即在size小于数组的最大下标情况下, size自加1,再给x赋值。请在注释“//**3**”之后添加适当的语句。(4)完成类stack的成员函数pop的定义,该函数返回栈顶元素的值,即在size不等于-1的情况下,返回数组中下标为size的元素的值,并将size减1。请在注释“//**4**”之后添加适当的语句。程序输出结果如下:the top elem:1the pop elem:1the stack is empty注意:除在指定位置添加语句之外,请不要改动程序中的其他内容。源程序文件test34_3.cpp清单如下:include<iostream.h>class stack{//** 1 **public:stack ( );bool empty(){return size==-1;}bool full() {return size==99;}void push(int x);void pop();void top();};stack::stack(){//** 2 **for(int i=0; i<100; i++)*(sp+i)=0;size=-1;}void stack::push(int x){//** 3 **cout<<"the stack is full"<<end1;else{size++;*(sp+size) = x;}}void stack::pop(){//** 4 **cout<<"the stack is empty"<<end1;else{cout<<"the pop elem:"<<*(sp+size)<<end1;size--;}}void stack::top(){if iempty() )cout<<"the stack is empty"<<end1;else{cout<<"the top elem:"<<*(sp+size)<<end1;}}void main ( ){stack s;s.push(1);s.top();s.pop();s.top();}

阅读以下说明C++代码,将应填入(n)处的字句写在对应栏内。[说明]以下程序的功能是实现堆栈的一些基本操作。堆栈类stack共有三个成员函数:empty判断堆栈是否为空;push进行人栈操作;pop进行出栈操作。[C++程序]include "stdafx. h"include <iostream, h>eonst int maxsize = 6;class stack {float data[ maxsize];int top;public:stuck(void);~ stack(void);bool empty(void);void push(float a);float pop(void);};stack: :stack(void){ top =0;cout < < "stack initialized." < < endl;}stack:: ~stack(void) {cout < <" stack destoryed." < < endl;bool stack:: empty (void) {return (1);void stack: :push(float a)if(top= =maxsize) {cout < < "Stack is full!" < < endl;return;data[top] =a;(2);}float stack:: pop (void){ if((3)){cout< < "Stack is undcrflow !" < < endl;return 0;(4);return (5);}void main( ){ stack s;coat < < "now push the data:";for(inti=l;i =maxsize;i+ +) {cout< <i< <" ";s. push(i);}coat < < endl;cout< < "now pop the data:";for(i = 1 ;i < = maxsize ;i + + )cout< <s. pop()< <" ";}

下面的过程定义语句中不合法的是( )。A.Sub Para(ByVal n() )B.Sub Para(n) As IntegerC.Function Para(ByVal n)D.Function Para(proc1)

下述程序为一数据段,正确的判断是( )。 DATA SEGMENT X DB 332H FIRST = 1 FIRST EQU 2 ENDSA.以上5条语句为代码段定义,是正确的B.语句3、4分别为FIRST赋值,是正确的C.语句2定义变量X是正确的D.以上没有正确答案

The principle for a stack memory to store data isA.FIFOB.FILOC.randomD.other way

以下程序实现栈的入栈和出栈的操作。其中有两个类:一个是节点类node,它包含点值和指向上一个节点的指针 prev;另一个类是栈类 stack, 它包含栈的头指针 top。生成的链式栈如下图所示。〈IMG nClick=over(this) title=放大 src="tp/jsj/2jc++j28.1.gif"〉下面是实现程序,请填空完成此程序。include 〈iostream〉using namespace std;class stack;class node{int data;node *prev;public:node(int d, node *n){data=d;prev=n;}friend class stack;};class stack{node *top; //栈头public:stack(){top=0;}void push(int i){node *n=【 】;top=n;}int pop(){node *t=top;if (top){top=top-〉prev;int c= t-〉data;delete t;return c;}return 0;}int main (){stack s;s.push(6);s.push(3);s.push (1);return 0;}

在段定义伪指令语句中,下列哪一种组合类型是不可缺省的?A.PUBLICB.COMMONC.MEMORYD.STACK

下面是一个栈类的模板,其中push函数将元素i压入栈顶,pop函数弹出栈顶元素。栈初始为空,top值为0,栈顶元素在stack[top-1]中,在下面横线处填上适当的语句,完成栈类模板的定义。template<class t>class Tstack{enum{size=1000};T stack[size]int top;public:Tsack():top(0){}void push(const Ti){if(top<size)stack[top++]=i;}T pop(){if(top==O)exit(1);//栈空时终止运行retum【 】;}};

使用VC6打开考生文件夹下的工程MyProj8。此工程包含一个源程序文件MyMain8.cpp,该程序实现栈的入栈和出栈的操作。其中有两个类:一个是节点类node,它包含节点值和指向上一个节点的指针prey;另一个类是栈类stack,它包含栈的头指针top。但类的定义并不完整。请按要求完成下列操作,将类Sample的定义补充完成:①定义私有节点值data,它是血型的数据,以及定义一个指向上一个节点的指针prev。请在注释“//* *1* *”之后添加适当的语句。②完成构造函数node(int d,node*n)的定义,使得私有成员data和prev分别初始化为d和n。请在注释“//* *2* *”之后添加适当的语句。③完成类stack的成员函数push(int i)的类体内的定义。函数push()实现入栈这个操作,即把形参i压入栈中,那么此时应该创建一个新的节点,并让这个节点的prev指针指向栈顶。请在注释“//* *3 * *”之后添加适当的语句。注意:除在指定位置添加语句之外,请不要改动程序中的其他内容。源程序文件MyMain8.cpp清单如下://MyMain 8.cppinclude <iostream>using namespace std;class stack;class node{private://* * 1 * *public:node(int d, node *n){//* * 2 * *}friend class stack;};class stack{node *top; //栈头public:stack(){top=0;}void push(int i){//* * 3 * *}int pop(){node*t=top;if(top){top=top->prev;int c=t->data;delete t;return c;}return 0;}};int main(){stack s;s.push(6);s.push(3);s.push(1);return 0;}

被连接的汇编语言程序模块中,下面( )分段定义伪指令语句所使用组合类型是不可设为默认的。A.PUBLICB.COMMONC.MEMORYD.STACK

下述程序为一数据段,正确的判断的是( )。 DATA SEGMENT X DB 332H FIRST=1 FIRST EQU2 ENDSA.以上5条语句为代码段定义,是正确的B.语句3,4分别为FIRST赋值,是正确的C.语句2定义变量X是正确的D.以上没有正确的答案

●The principle for a stack memory to store data is () 。()A. FIFO B. FILO C. random D. other way

下面语句中是堆梳段定义的语句是()A、CODE SEGMENTB、DATA SEGME~TC、STACK SEGMENT ‘STACK’D、MAIN PROCFAR

下面语句中,是伪指令语句的有()。A、CMP AX,CXB、DB?C、IDIV CXD、ORG 30HE、DATA SEGMENT

子程序是用过程定义语句()定义的。A、PROC    ENDPB、PROC    ENDSC、CALL    RETD、PROC    RET

下列选项中是用来定义结构体的关键字是()。A、structB、functionC、staticD、stack

Multi Protocol Label Switching (MPLS) is a data-carrying mechanism that belongs to the family of packet-switched networks. For an MPLS label, if the stack bit is set to1, which option is true?()A、The stack bit will only be used when LDP is the label distribution protocolB、The label is the last entry in the label stack.C、The stack bit is for Cisco implementations exclusively and will only be used when TDP is the label distribution protocol.D、The stack bit is reserved for future use.

数组元素所占用的内存位于()  A、数据区(Data)B、代码区(Code)C、堆(Heap)D、堆栈(Stack)

You are creating an undo buffer that stores data modifications.You need to ensure that the undo functionality undoes the most recent data modifications first.You also need to ensure that the undo buffer permits the storage of strings only.Which code segment should you use?()A、Stackstring undoBuffer=new Stackstring();B、Stack undoBuffer=new Stack();C、Queuestring undoBuffer=new Queuestring();D、Queue undoBuffer=new Queue();

单选题Multi Protocol Label Switching (MPLS) is a data-carrying mechanism that belongs to the family of packet-switched networks. For an MPLS label, if the stack bit is set to1, which option is true?()AThe stack bit will only be used when LDP is the label distribution protocolBThe label is the last entry in the label stack.CThe stack bit is for Cisco implementations exclusively and will only be used when TDP is the label distribution protocol.DThe stack bit is reserved for future use.

单选题下面语句中是堆桔段定义的语句是()。ACODE SEGMENTBDATA SEGMENTCSTACK SEGMENT ‘STACK’DMAIN PROC FAR

单选题下面语句中是堆梳段定义的语句是()ACODE SEGMENTBDATA SEGME~TCSTACK SEGMENT ‘STACK’DMAIN PROCFAR

多选题下面语句中,是伪指令语句的有()。ACMP AX,CXBDB?CIDIV CXDORG 30HEDATA SEGMENT

单选题若程序中对堆栈设置如下,则下列说法错误的是()。 size   .set    120 stack  .usect  “STACK”,size                STM     # stack + size,SPA此堆栈段的段名为STACKB此堆栈段共120个单元C此堆栈段第一个变量的名称为sizeD堆栈设置好后,堆栈指针SP指向栈底

单选题You are creating an undo buffer that stores data modifications.You need to ensure that the undo functionality undoes the most recent data modifications first.You also need to ensure that the undo buffer permits the storage of strings only.Which code segment should you use?()AStackstring undoBuffer=new Stackstring();BStack undoBuffer=new Stack();CQueuestring undoBuffer=new Queuestring();DQueue undoBuffer=new Queue();

单选题数组元素所占用的内存位于()A数据区(Data)B代码区(Code)C堆(Heap)D堆栈(Stack)