That the program is out of its small, temporary space to write down things it needs to remember for a while. When you need to write things down not to get lost and you can’t – you get lost. You can’t complete the task. It usually means the program is broken. That it goes in circles writing the same things over and over again. Very rarely it could also mean the temporary space (the stack) is too small to fit the things. Now: why stack, and why it’s small and for only temporary things? Because it is a portion of a computer memory it gets for free. It is also the block of memory the same as the one the program is in. So – they are close to each other. The program and the stack. It’s near. It’s handy. The program can get this data very, very fast. It’s called stack because it is a stack. Like a stack of little papers. You can put a card on top, then take a card off the top. It’s also a fast thing. You don’t need to search. You just take a card. Now you know why it’s small and used for temporary things. When you need to store large data, you use a book. With page numbers, index and all. That is memory. In programming it’s often called heap. In order to get something from there you must specify what do you need and from which exact location. When you want something from stack you just take it. It’s the last thing you put there. When you solve problems you usually put some info for later, then take it from stack, when you take it and use it, it’s no longer taking space. So you put some data, take some data. And it never overflows. When you only put data, but you don’t take it out, it stays there, put too many little cards on the stack and it overflows. Putting data on stack without taking it from it doesn’t make sense. So if the program does it – it’s something wrong with it and it does something different from it was intended to do.
Latest Answers