Another idea for you is if you cant change your class you can use a std::deque<TYPEOFSTACK> and push_front the popped off the stack value, then copy the deque to cout using the copy algorithm and ostream_iterators
for instance if you have a stack of ints...
// fill stack here
// fill deque with popped values
// now you would have to put the values in the deque back in your stack