SpaceX interview question

Difference between stack and heap

Interview Answer

Anonymous

8 Jul 2015

stack is automatically handled. Stack is allocated at call of function then released when exiting function, it also allows to store local variables. heap is memory that lasts as long as needed and must be explicitly deleted using the delete or free function.