Ok, im writing a RPN calculator in c++. I want to use a stack to store the different numbers, but im running into trouble. I can't seem to display the stack without deleting the stack. The only code I've thought of or seen online consists if the following:
This'd be great but I want to preserve the stack. Can I copy it, or am I missing some feature of the stacks?
Thanks,
Rokem
Code:
while (!stack.empty())
{
cout << stack.top() << endl;
stack.pop;
}
This'd be great but I want to preserve the stack. Can I copy it, or am I missing some feature of the stacks?
Thanks,
Rokem