<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>static function in c - Wikitechy</title>
	<atom:link href="https://www.wikitechy.com/interview-questions/tag/static-function-in-c/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.wikitechy.com/interview-questions/tag/static-function-in-c/</link>
	<description>Interview Questions</description>
	<lastBuildDate>Mon, 03 Oct 2022 06:44:01 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://www.wikitechy.com/interview-questions/wp-content/uploads/2025/10/cropped-wikitechy-icon-32x32.png</url>
	<title>static function in c - Wikitechy</title>
	<link>https://www.wikitechy.com/interview-questions/tag/static-function-in-c/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>What is Static Variable in C ?</title>
		<link>https://www.wikitechy.com/interview-questions/c/what-is-static-variable-in-c/</link>
					<comments>https://www.wikitechy.com/interview-questions/c/what-is-static-variable-in-c/#respond</comments>
		
		<dc:creator><![CDATA[webmaster]]></dc:creator>
		<pubDate>Mon, 03 Oct 2022 06:43:13 +0000</pubDate>
				<category><![CDATA[C]]></category>
		<category><![CDATA[how to implement static variable in c]]></category>
		<category><![CDATA[local static variable in c]]></category>
		<category><![CDATA[local static variables what is their use]]></category>
		<category><![CDATA[scope of static variable in c]]></category>
		<category><![CDATA[static function in c]]></category>
		<category><![CDATA[static in c]]></category>
		<category><![CDATA[static variable example]]></category>
		<category><![CDATA[static variable in c]]></category>
		<category><![CDATA[static variables in c]]></category>
		<category><![CDATA[static variables in c programming language]]></category>
		<category><![CDATA[what is the use of static variable in c]]></category>
		<category><![CDATA[why are static variables used in c]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=4907</guid>

					<description><![CDATA[Static variable have a property of preserving their value even after they are out of their scope. Static variable preserve their previous values in their previous scope and are not initialized again the new scope. Syntax Here data_type –&#62; Data types like int, char, float etc. Var_name -&#62; Name of the variable given by user. [&#8230;]]]></description>
										<content:encoded><![CDATA[<ul>
<li style="text-align: justify;">Static variable have a property of preserving their value even after they are out of their scope.</li>
<li style="text-align: justify;">Static variable preserve their previous values in their previous scope and are not initialized again the new scope.</li>
</ul>
<h2 id="syntax" style="text-align: justify;">Syntax</h2>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-c code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-c code-embed-code">static data_type var_name = var_value;</code></pre> </div>
<ul style="text-align: justify;">
<li>Here <strong>data_type</strong> –&gt; Data types like int, char, float etc.</li>
<li><strong>Var_name</strong> -&gt; Name of the variable given by user.</li>
<li><strong>Value</strong> -&gt; Any value to initialize. By default, it is zero.</li>
</ul>
<p><img fetchpriority="high" decoding="async" class="alignnone size-full wp-image-4908 aligncenter" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/static-variable-in-c.jpg" alt="" width="751" height="377" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/static-variable-in-c.jpg 751w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/static-variable-in-c-300x151.jpg 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/static-variable-in-c-390x196.jpg 390w" sizes="(max-width: 751px) 100vw, 751px" /></p>
<ul style="text-align: justify;">
<li>A static variable remains in the memory while the program is running.</li>
<li>Static variables are allocated memory in data segment, not in stack segment.</li>
<li>Default values of static variables is assigned as 0 if not initialized explicitly.</li>
<li>In C, static variables can be initialized using constant literals.</li>
<li>Static global variables and functions are possible in C. The purpose of these is to limit scope of a variable or function to file.</li>
<li>Static variables cannot be declared inside the structure. The reason is compiler requires the entire structure elements to be placed together.</li>
<li>Memory allocation for structure members should be contiguous.</li>
</ul>
<p style="text-align: justify;">
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/c/what-is-static-variable-in-c/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
