The term dynamic allocation is often not used in this context. In some ways it's true. This type of allocation takes place in the stack , so it always occurs at run time, in this respect we can say that the allocation is dynamic, as opposed to being static when the data is already in the binary code and the allocation was done at compile time. However, if you think well, this data is still dynamic because the effective allocation only occurs in the executable load.
The term has dropped a bit in disuse, but the correct one for the allocation on the stack is automatic allocation , so it differs from static. In a sense the memory there is static since the whole stack is usually fixed and allocated in advance. Then there is a general prior allocation in the executable load and then an internal allocation during execution that each stack frame .
By all this we consider that these allocations are always static or automatic, and the dynamic allocation is the one you ask for allocate in heap and it is accessed by value or through a reference somewhere.
Dynamic allocation needs some management while static allocation is managed automatically. This management can be automated through a garbage collector ( garbage collector ) or < a href="https://en.stackoverflow.com/q/43766/101"> manual .
The term "static variables" is completely wrong. The allocation can have this feature, a variable .
Dynamic allocation does not necessarily have to be through pointers, but almost always ends up being accessed as well. But in a way all access is done like this, is that in some cases the address of the pointer is already in the code and probably the processor makes the access free or even transparent. Everything is done with indirection .
In automatic memory, nothing is ever released, just stop using that space.
Therefore, within the area of our area the author is wrong, as well as the answers posted here (which even err on points that are not even the focus of the question). The author talks about scope and lifetime .