Question: what is the difference between dynamic variables and automatic variables?
Answer: Automatic variables are stored in a "function call stack". Dynamic: The lifetime of a dynamic object begins when memory is allocated for the object (e.g., by a call to malloc() or using new) and ends when memory is deallocated (e.g., by a call to free() or using delete). Dynamic objects are stored in "the heap".