The lifetime (or storage duration) of a variable is the part of the run during which it exists and keeps its value. An automatic variable, a parameter or a local declared without static, lives from the entry into its block to the exit from it, in the current frame; each call has its own. A static variable, a local declared with static, has block scope but lives for the whole run, in the data segment, and is initialised once, before main starts. A global variable, declared at file scope, also lives for the whole run, and its name is visible to the whole file.
Computer Science · Glossaire
Qu'est-ce que « Lifetime; automatic, static and global variables » ?
Aussi appelé : lifetime (of a variable) · automatic variable · static variable · global variable