Stack problem(member functios)

I have a very simple question. I know what to do, but confused.

I am working with an assignment. I need to create a stack of books, and its methods(member functions) are:
1. get_info()
2. display()
3. update();
where get_info() stands for push(); i.e., takes inputs from the user.
Now, I am confused about display() and update(). What should exactly these two functions hold?

My opinion: display() stands for pop(), i.e., it displays the current elements of stack.
And update() stands for top element, i.e., last element pushed into stack.

Q1: Is really the display() displays the current elements? Is it displays after pop out the elements? Are display() and pop() same things?

Q2: If I display by poping out the elements, at a certain time, my stack becomes empty. Then how can I find out the top element by calling update()?


Any suggestion? :)
Topic archived. No new replies allowed.