A portion of the RAM on a computer is reserved for the “stack” which is for data that is very transient, such as the data passed to a function in a program as arguments. In more “user friendly” language like python, the programmer doesn’t need to be aware of this or think about it, but in languages like C and C++ when you create a variable, it goes to the stack unless you explicitly create it in a way that it is stored in the rest of the non-stack RAM. If your program tries to put too much data into the stack and it fills up the space that was reserved for it, then it is called a stack overflow.
Latest Answers