<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://wiki.karljones.com/index.php?action=history&amp;feed=atom&amp;title=Static_variable</id>
		<title>Static variable - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://wiki.karljones.com/index.php?action=history&amp;feed=atom&amp;title=Static_variable"/>
		<link rel="alternate" type="text/html" href="http://wiki.karljones.com/index.php?title=Static_variable&amp;action=history"/>
		<updated>2026-10-23T11:56:08Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.24.2</generator>

	<entry>
		<id>http://wiki.karljones.com/index.php?title=Static_variable&amp;diff=17314&amp;oldid=prev</id>
		<title>Karl Jones: Created page with &quot;In computer programming, a '''static variable''' is a variable that has been allocated statically so that its lifetime or &quot;extent&quot; extends...&quot;</title>
		<link rel="alternate" type="text/html" href="http://wiki.karljones.com/index.php?title=Static_variable&amp;diff=17314&amp;oldid=prev"/>
				<updated>2016-08-26T21:32:03Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;In &lt;a href=&quot;/index.php/Computer_programming&quot; title=&quot;Computer programming&quot;&gt;computer programming&lt;/a&gt;, a &amp;#039;&amp;#039;&amp;#039;static variable&amp;#039;&amp;#039;&amp;#039; is a &lt;a href=&quot;/index.php/Variable_(computer_science)&quot; title=&quot;Variable (computer science)&quot;&gt;variable&lt;/a&gt; that has been allocated statically so that its lifetime or &amp;quot;extent&amp;quot; extends...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;In [[computer programming]], a '''static variable''' is a [[Variable (computer science)|variable]] that has been allocated statically so that its lifetime or &amp;quot;extent&amp;quot; extends across the entire run of the program.&lt;br /&gt;
&lt;br /&gt;
This is in contrast to the more ephemeral automatic variables (local variables are generally automatic), whose storage is allocated and deallocated on the call stack; and in contrast to objects whose storage is dynamically allocated in heap memory.&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
Static memory allocation in general is the allocation of memory at compile time before the associated program is executed, unlike dynamic memory allocation or automatic memory allocation where memory is allocated as required at [[Run time (program lifecycle phase)|run time]].&lt;br /&gt;
&lt;br /&gt;
The absolute address addressing mode can only be used with static variables, because those are the only kinds of variables whose location is known by the compiler at compile time.&lt;br /&gt;
&lt;br /&gt;
When the program (executable or library) is loaded into memory, static variables are stored in the data segment of the program's address space (if initialized), or the BSS segment (if uninitialized), and are stored in corresponding sections of object files prior to loading.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;static&amp;lt;/code&amp;gt; keyword is used in C and related languages both for static variables and other concepts.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[Constant (computer programming)]]&lt;br /&gt;
* [[Global variable]]&lt;br /&gt;
* [[Run time (program lifecycle phase)]]&lt;br /&gt;
* [[Static method]]&lt;br /&gt;
* [[Thread-local storage]]&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
* [https://en.wikipedia.org/wiki/Static_variable Static variable] @ Wikipedia&lt;br /&gt;
&lt;br /&gt;
[[Category:Computer programming]]&lt;/div&gt;</summary>
		<author><name>Karl Jones</name></author>	</entry>

	</feed>