[Tutor] Can someone please explain a Stack Trace

Sean 'Shaleh' Perry shalehperry@home.com
Wed, 03 Oct 2001 12:35:43 -0700 (PDT)


> 
> A "stack" is a LIFO (last in, first out) data structure. As such, it "pushes"
> items down and returns and removes the topmost when "popped".
> 
> The location where every function call has been made is pushed onto the
> stack,
> and a "stack trace" is simply the list of locations contained in that stack.
> 

The best real world example I have seen explained uses dinner plates.  You
start with a plate.  The next night you decide not to do dishes and place that
plate on the previous one.  This continues until it is time to do dishes.  You
then remove the plates in reverse order (as Ignacio says, Last In, First out).

A "stack trace" would be equivalent to looking through the plate for what you
had for dinner two nights ago.  You would remove enough plates
one after the other to get back to the right plate.