Assign values of a stack to another stack
问题 I am working on this assignment. I need to create a temporary stack without initializing it. Then push the items of stack 1 into this temporary stack using a while loop. Then I need to use another (nested?) loop to walk through the temp stack and add the items from temp stack onto stack 2. Then I need to set stack 1 and 2 equal so stack 2 remains unchanged. 回答1: Your interfaces look a bit off. Let's start there and see if that gets you over your hump. stack.top() usually peeks at an item, but