Well, I think the proper analogy would be to write something on the papers, going from the top. The stack of written on paper would then expand from the top. The stack is already there, your program only allocates part of it, writing on it while in use.
Correct. "Grow" probably isn't the best choice of words here, but it's the one that's commonly used. Heaps don't actually "grow" either. They just occupy more of the memory that already exists.
But yes, the minimum address that the stack occupies will decrease as the stack gets bigger, while the maximum address remains the same.
9
u/Bo_Jim Oct 21 '21
Technically, stacks grow downward, so isn't the Stack Overflow logo upside down?