Difference between statc and dynamic

In reply to nana:

The difference is not really how much memory, but when the memory gets allocated and initialized. There are actually three kinds of storage categories; static, automatic, and dynamic.

Static and automatic storage are part of the declaration of a variable of any type. Static variables get allocated and initialized before time 0 and are never deallocated. Automatic variables get allocated and initialized when entering a procedural scope like a task or function. They get deallocated when exiting the scope.

Dynamic storage is associated with the variable’s type. You can procedurally change the size of an array, queue, or string, as well as construct a class object as any time. The variable that references the array or class can still be declared static or automatic.