<s>
In	O
computer	B-General_Concept
programming	I-General_Concept
,	O
an	O
automatic	B-General_Concept
variable	I-General_Concept
is	O
a	O
local	O
variable	O
which	O
is	O
allocated	O
and	O
deallocated	O
automatically	O
when	O
program	O
flow	O
enters	O
and	O
leaves	O
the	O
variable	O
's	O
scope	B-Language
.	O
</s>
<s>
The	O
scope	B-Language
is	O
the	O
lexical	O
context	O
,	O
particularly	O
the	O
function	O
or	O
block	O
in	O
which	O
a	O
variable	O
is	O
defined	O
.	O
</s>
<s>
Local	O
data	O
is	O
also	O
invisible	O
and	O
inaccessible	O
to	O
a	O
called	O
function	O
,	O
but	O
is	O
not	O
deallocated	O
,	O
coming	O
back	O
in	O
scope	B-Language
as	O
the	O
execution	O
thread	O
returns	O
to	O
the	O
caller	O
.	O
</s>
<s>
Automatic	O
local	O
variables	O
primarily	O
applies	O
to	O
recursive	O
lexically-scoped	B-Language
languages	O
.	O
</s>
<s>
Automatic	O
local	O
variables	O
are	O
normally	O
allocated	B-General_Concept
in	I-General_Concept
the	I-General_Concept
stack	I-General_Concept
frame	I-General_Concept
of	O
the	O
procedure	O
in	O
which	O
they	O
are	O
declared	O
.	O
</s>
<s>
This	O
was	O
originally	O
done	O
to	O
achieve	O
re-entrancy	B-Operating_System
and	O
allowing	O
recursion	O
,	O
a	O
consideration	O
that	O
still	O
applies	O
today	O
.	O
</s>
<s>
The	O
concept	O
of	O
automatic	B-General_Concept
variables	I-General_Concept
in	O
recursive	O
(	O
and	O
nested	O
)	O
functions	O
in	O
a	O
lexically	O
scoped	O
language	O
was	O
introduced	O
to	O
the	O
wider	O
audience	O
with	O
ALGOL	B-Language
in	O
the	O
late	O
1950s	O
,	O
and	O
further	O
popularized	O
by	O
its	O
many	O
descendants	O
.	O
</s>
<s>
The	O
term	O
local	O
variable	O
is	O
usually	O
synonymous	O
with	O
automatic	B-General_Concept
variable	I-General_Concept
,	O
since	O
these	O
are	O
the	O
same	O
thing	O
in	O
many	O
programming	O
languages	O
,	O
but	O
local	O
is	O
more	O
general	O
–	O
most	O
local	O
variables	O
are	O
automatic	O
local	O
variables	O
,	O
but	O
static	O
local	O
variables	O
also	O
exist	O
,	O
notably	O
in	O
C	O
.	O
For	O
a	O
static	O
local	O
variable	O
,	O
the	O
allocation	O
is	O
static	O
(	O
the	O
lifetime	O
is	O
the	O
entire	O
program	O
execution	O
)	O
,	O
not	O
automatic	O
,	O
but	O
it	O
is	O
only	O
in	O
scope	B-Language
during	O
the	O
execution	O
of	O
the	O
function	O
.	O
</s>
<s>
(	O
Called	O
automatic	B-General_Concept
variables	I-General_Concept
.	O
)	O
</s>
<s>
An	O
uninitialized	O
automatic	B-General_Concept
variable	I-General_Concept
has	O
an	O
undefined	B-Language
value	O
until	O
it	O
is	O
assigned	O
a	O
valid	O
value	O
of	O
its	O
type	O
.	O
</s>
<s>
In	O
C	O
,	O
using	O
the	O
storage	O
class	O
register	O
is	O
a	O
hint	O
to	O
the	O
compiler	O
to	O
cache	O
the	O
variable	O
in	O
a	O
processor	B-General_Concept
register	I-General_Concept
.	O
</s>
<s>
In	O
C++	O
,	O
the	O
constructor	O
of	O
automatic	B-General_Concept
variables	I-General_Concept
is	O
called	O
when	O
the	O
execution	O
reaches	O
the	O
place	O
of	O
declaration	O
.	O
</s>
<s>
See	O
Resource	B-Application
Acquisition	I-Application
Is	I-Application
Initialization	I-Application
(	O
RAII	B-Application
)	O
.	O
</s>
<s>
Since	O
C++11	O
,	O
C++	O
allows	O
variables	O
to	O
be	O
declared	O
with	O
the	O
auto	O
type	O
specifier	O
,	O
but	O
this	O
means	O
that	O
the	O
variable	O
's	O
type	O
is	O
inferred	O
,	O
and	O
does	O
not	O
refer	O
to	O
the	O
scope	B-Language
of	O
the	O
variable	O
.	O
</s>
<s>
Perl	O
also	O
has	O
a	O
local	O
operator	O
that	O
does	O
not	O
create	O
automatic	B-General_Concept
variables	I-General_Concept
,	O
instead	O
giving	O
global	O
(	O
package	O
)	O
variables	O
a	O
temporary	O
value	O
,	O
which	O
is	O
dynamically	B-Language
scoped	I-Language
to	O
the	O
enclosing	O
block	O
.	O
</s>
<s>
When	O
the	O
scope	B-Language
of	O
the	O
variable	O
is	O
left	O
,	O
the	O
old	O
value	O
is	O
restored	O
.	O
</s>
