>I was trying to create a function empty() to display the
>entire list of entries after a pop
That's a poor name for the function. People expect a function with the name empty(), to tell them whether or not the stack is empty, not print the contents of the stack. But you can do it like this:
void link_stack::print_all()
{
for ( node *p = top; p != 0; p = p->next )
cout<< p->id <<": "<< p->name <<'\n';
}
Reputation Points: 6442
Solved Threads: 1393
Bad Cop
Offline 11,807 posts
since Sep 2004