Question: what is difference between static memory and dynamic memory?
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.