Copy constructor
Create an empty stack (stack1) and push 3 values onto it. Copy the stack (stack2) and
check the head pointers are different. Pop the data from the copy and confirm the values
are correct. Check for exceptions. |
stack stack1
stack.push() three times
stack stack2(stack1)
stack1.head != stack2.head
stack2.pop() three times
|
x, y, z
true
z, y, x
no exceptions
|