Question: Consider the following code. In this code the function displayClass ( stackClass ) is called. Which of the following code ( i ) represents the
Consider the following code.
In this code the function displayClassstackClass is called.
Which of the following code i represents the correct implementation of the DISPLAYCLASS function?
#include
#include i missing code for the function.
int main
std::stack stackClass;
stackClass.pushJohn;
stackClass.pushPeter;
stackClass.pushMary;
DISPLAYCLASSstackClass;
return ;
a void displayClassstd::stack myStack
while myStack.empty
std::cout myStack.top
;
myStack.pop;
b void displayClassstd::stack myStack
while myStack.empty
myStack.pop;
std::cout myStack.top
;
c None of the options provided.
d void displayClassstd::stack myStack
while myStack.empty
std::cout myStack.top
;
myStack.pop;
e void displayClassstd::stack myClass
myStack myClass;
while myStack.empty
myStack.pop;
std::cout myStack.top
;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
