2 of 4
added 389 characters in body
svidgen
  • 14.7k
  • 3
  • 37
  • 61

You push items onto and pop them off of the top of the stack, regardless of how it is laid out in memory.

The stack terminology is intended to mirror a physical stack. You can't very easily manage a physical stack from the bottom.


Strictly speaking, an exception propagates down the stack, from the most recently called function to the least recently called function. But, when someone says "propagates up the stack," we understand what they mean. Whether it's up or down in their heads isn't as relevant as whether they ultimately mean "most recent" to "least recent" (or "in opposite order of invocation").

svidgen
  • 14.7k
  • 3
  • 37
  • 61