Quote Originally Posted by Elysia View Post
I would make pop return the element that is removed and rename top to peek. I don't know why they did it like this in STL, but frankly, it's annoying and peek/pop is pretty much standard anyway.
And StainedBlue, as we have already tried to explain, the OP should not be using dynamic memory at this point. A stack does not need dynamic memory. A vector or a deque should suffice here. Let's not try to put out different solutions here. It will only serve to confuse.
Why not just make a vector wrapper, and forget manual memory management all together then?

EDIT: By that I mean, why does the OP have a pointer at all?