 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
• |
Lifetime
is the period of time during program
|
|
|
execution
when an identifier actually has memory
|
|
|
allocated
to it.
|
|
|
• |
Two
types of variables
|
|
|
|
– |
Static
variables – storage remains allocated for the
|
|
|
duration
of the entire program
|
|
|
|
– |
Automatic
variables – storage is allocated at block entry
|
|
and
deallocated at block exit
|
|
|
• |
By
default, variables declared within a block are
|
|
|
automatics,
this can be changed using the reserved
|
|
|
word static.
|
|