Image

Imagelittlewhilegone wrote in Imagecpp

How can I modify this client program to view the last two items pushed into the stack?

int main(){

Stack stack;
int items[15];

int stackTop;
for (int i=0; i<15; i++) {
items[i] = i;

stack.push(items[i]);

}
while (!stack.isEmpty()) {
stack.pop(stackTop);
cout < < stackTop < < endl;

}



return 0;