Imagine you’re typing instructions onto pieces of paper, and then putting them into a cardboard box. Pretty soon you’ll have a **stack** of papers. Now imagine that you want to close the box, but you can’t because you put too many papers onto the stack; that’s an **overflow**.
In a computer, the box is called memory and it collects a stack of instructions called machine code. Eventually, if you keep putting instructions into the box faster than the computer can take them out and read them, the stack of instructions will get too big for the box. If that happens, your computer won’t be able to reach the top of the stack of instructions anymore, so it gives you an error to let you know it can’t do its job anymore. That’s called a stack overflow.
If you need a more technical answer, the stack is a fixed-size sequence of memory that is set aside for instructions during a software application’s runtime. It is called a stack because it uses the FILO (first in, last out) paradigm of command execution, wherein instructions are executed in reverse order of when they were placed, such that the last instruction stored in the stack will be the first instruction removed from it. Once the stack is full, it cannot accept new instructions before processing what it already has, so it will give a stack overflow error if you try to give it more instructions at once than it can handle.
[Stack Overflow](https://stackoverflow.com/) is also the name of a forum programmers often go to for questions about programming.
Latest Answers