Automatic variable: Difference between revisions

Content deleted Content added
Bhbuehler (talk | contribs)
add about hatnote for C++ auto keyword;
Bhbuehler (talk | contribs)
m change case of link for easier reading;
Line 1:
{{About|Automatic variables|the C++ keyword {{Cpp|auto}} used for [[Typetype inference]]|C++11#Type inference}}
__NOTOC__
In [[computer programming]], an '''automatic variable''' is a local [[Variable (programming)|variable]] which is allocated and deallocated automatically when program flow enters and leaves the variable's scope. The [[Scope (computer science)|scope]] is the lexical context, particularly the function or block in which a variable is defined. Local data is typically (in most languages) invisible outside the function or lexical context where it is defined. Local data is also invisible and inaccessible to a ''called'' function,<ref group="note">unless it is a [[nested function]], which itself is ''defined'' along that local data</ref> but is not deallocated, coming back in scope as the [[execution thread]] returns to the caller.