Programming in C++ Lifetime of Global variables their lifetime is the lifetime of the entire program their memory is allocated when program begins execution otheir memory is deallocated when the entire program terminates 16
16 Lifetime of Global Variables ❖their lifetime is the lifetime of the entire program ❖their memory is allocated when program begins execution ❖their memory is deallocated when the entire program terminates
Programming in C++ Automatic vs Static Variable ☆ storage for ☆ storage for statIc automatic variable variable remains is allocated at block allocated throughout entry and execution of the deallocated at block entire program exit
17 Automatic vs. Static Variable ❖storage for automatic variable is allocated at block entry and deallocated at block exit ❖storage for static variable remains allocated throughout execution of the entire program