When we consider the various storage classes, not only do we consider when they are created and accessed, but we must also consider when they are deallocated or destroyed. This is their lifetime—from creation to destruction.
Automatic, internal variables are created when the variable is declared either in the body of a compound statement or in a function's formal parameter list. Internal variables are destroyed and no longer accessible when that compound statement or function is exited.
Consider the doSomething() function. The aReal, aNumber, d1, d2, n1, and n2variables are created when the function is called. All of them are destroyed after the function returns its d2 value. The iloop variable is created when we enter the loop and is destroyed when we exit that outer loop. The j variable is created at each iteration of the outer loop controlled by i and destroyed at the completion of the inner loop controlled by j...