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...
Code:
std::deque<int> cont;
Stack thestack;
// fill stack here
while(!thestack.empty())
{
// fill deque with popped values
cont.push_front(thestack.pop());
}
std::copy(cont.begin(),cont.end(),std::ostream_iterator<int>(std::cout," "));
// now you would have to put the values in the deque back in your stack
while(!cont.empty())
{
thestack.push(cont.front());
cont.pop_front();
}