system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: Stack vs. Heap

My current major is computer science and I am stumped with this concept of "Stack vs. Heap" in memory.
gpt
The stack and the heap are two different regions of memory your program can access.  The main difference is how they're managed.

The Stack is memory that's managed (to some degree) for you.  When you declare a variable from within a function the memory for that variable is allocated from the stack.  This allows the memory to automatically be returned (deallocated) when the function returns.  

The heap is memory that is NOT managed for you.  When you malloc something you are taking a chunk of memory from the heap.  It will last forever until you explicitly free it.