Question: what is the difference between static and dynamic memory allocation?
Answer: Static memory is allocated on stack, while dynamic memory is allocated on heap. Dynamic memory needs to be manually release after use, while static memory is released itself once the binding variable scope is over.