Given the following stack declaration, which of the following function definitions would correctly implement the destructor?

struct StackFrame
{
char data;
StackFrame *link;
};
typedef StackFrame* StackFramePtr;

class Stack
{
public:
Stack( );
Stack(const Stack& a_stack);
~Stack( );
void push(char the_symbol);
char pop( );
bool empty( ) const;
private:
StackFramePtr top;
};
a. top=NULL;
b.
char next;
while (! empty( ))
next = pop( );//pop calls delete.
c.
char next;
while(!empty( ))
next = push();
d. none of the above


b.
char next;
while (! empty( ))
next = pop( );//pop calls delete.

Computer Science & Information Technology

You might also like to view...

Repeated table heading rows are only seen in Print Layout view

Indicate whether the statement is true or false

Computer Science & Information Technology

In the event of a duplicate MAC address shared by two hosts on a switched network, what statement is accurate?

a. The hosts that share the same MAC addresses will be completely unable to communicate with any other devices. b. The hosts will generate new MAC addresses until the conflict is resolved. c. The hosts will still send and receive traffic, but traffic may not always reach the correct destination. d. The network switch will eventually crash due to being unable to properly forward traffic.

Computer Science & Information Technology

Which of the following is an online source that contains the latest contract award information?

a. GSA eLibrary b. GSA eOffer c. GSA eMod d. GSA eBuy

Computer Science & Information Technology

An _______ condition occurs when the IS equipment receives less voltage than is required for normal operation.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology