<?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>local and global | Student Projects</title>
	<atom:link href="https://studentprojects.in/tag/local-and-global/feed/" rel="self" type="application/rss+xml" />
	<link>https://studentprojects.in</link>
	<description>Microcontroller projects, Circuit Diagrams, Project Ideas</description>
	<lastBuildDate>Tue, 01 May 2012 15:17:44 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.1.7</generator>
	<item>
		<title>What is a global variable?</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c-faq/global-variable/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c-faq/global-variable/#respond</comments>
		
		<dc:creator><![CDATA[Chitra]]></dc:creator>
		<pubDate>Tue, 14 Feb 2012 17:59:36 +0000</pubDate>
				<category><![CDATA[C Questions & Answers]]></category>
		<category><![CDATA[variables]]></category>
		<category><![CDATA[variable types]]></category>
		<category><![CDATA[local and global]]></category>
		<category><![CDATA[global]]></category>
		<category><![CDATA[local and global variables]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=2665</guid>

					<description><![CDATA[<p>variables that are known throughout the program and may be used by any piece of code is called a global variable. Also, they will hold their value throughout the program&#8217;s execution. Global variables can be created by declaring them outside of any function. Global variables are helpful when many functions in the program use the</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c-faq/global-variable/">What is a global variable?</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>variables that are known throughout the program and may be used by any piece of code is called a global variable. Also, they will hold their value throughout the program&#8217;s execution. Global variables can be created by declaring them outside of any function.</p>
<p>Global variables are helpful when many functions in the program use the same data. Storage for global variables is in a fixed region of memory set aside for this purpose by the compiler.</p>
<p>In the following program, the variable count has been declared outside of all functions.</p>
<p>Example:</p>
<pre lang="c">#include "stdio.h"
int count;  /* count is global  */
void func1(void);
int main(void)
{
  count = 100;
  func1();
  return 0;
}
void func1(void)
{
  printf("count is %
d", count); /* will print 100 */
}</pre><p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c-faq/global-variable/">What is a global variable?</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/c-tutorials/c-faq/global-variable/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>What is a local variable?</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c-faq/local-variable/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c-faq/local-variable/#respond</comments>
		
		<dc:creator><![CDATA[Chitra]]></dc:creator>
		<pubDate>Tue, 14 Feb 2012 09:47:40 +0000</pubDate>
				<category><![CDATA[C Questions & Answers]]></category>
		<category><![CDATA[automatic]]></category>
		<category><![CDATA[variables]]></category>
		<category><![CDATA[variable types]]></category>
		<category><![CDATA[local and global]]></category>
		<category><![CDATA[auto]]></category>
		<category><![CDATA[automatic variables]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=2661</guid>

					<description><![CDATA[<p>Variables that are declared inside a function are called local variables. Local variables can be used only by statements that are inside the block in which the variables are declared. In other words, local variables are not known outside their own code block. A block of code begins with an opening curly brace and terminates</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c-faq/local-variable/">What is a local variable?</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>Variables that are declared inside a function are called local variables. Local variables can be used only by statements that are inside the block in which the variables are declared. In other words, local variables are not known outside their own code block. A block of code begins with an opening curly brace and terminates with a closing curly brace.</p>
<p>Local variables exist only while the block of code in which they are declared is executing. That is, a local variable is created upon entry into its block and destroyed upon exit. Furthermore, a variable declared within one code block has no bearing on or relationship to another variable with the same name declared within a different code block.</p>
<p>Example:</p>
<pre lang="c" escaped="true">
void func1(void) 
{ 
  int y; 
  y = 10;
}
void func2(void)
{ 
  int y;
  y = -199;
}
</pre>
<p>The integer variable y is declared twice, once in func1( ) and once in func2( ). The y in func1( ) has no relationship to the y in func2( ). This is because each y is known only to the code within the block in which it is declared.</p>
<p>The C language contains the keyword auto, which can be used to declare local variables. However, since all variables are, by default, assumed to be auto, this keyword is virtually never used. </p><p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c-faq/local-variable/">What is a local variable?</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/c-tutorials/c-faq/local-variable/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
