<?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>storage classes | Student Projects</title>
	<atom:link href="https://studentprojects.in/tag/storage-classes/feed/" rel="self" type="application/rss+xml" />
	<link>https://studentprojects.in</link>
	<description>Microcontroller projects, Circuit Diagrams, Project Ideas</description>
	<lastBuildDate>Thu, 27 Jan 2011 12:28:39 +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 the use of extern in c/c++?</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c-faq/what-is-the-use-of-extern-in-cc/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c-faq/what-is-the-use-of-extern-in-cc/#respond</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Thu, 27 Jan 2011 12:28:39 +0000</pubDate>
				<category><![CDATA[C Questions & Answers]]></category>
		<category><![CDATA[C Programs]]></category>
		<category><![CDATA[extern]]></category>
		<category><![CDATA[storage classes]]></category>
		<category><![CDATA[example]]></category>
		<category><![CDATA[extern variables]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=1225</guid>

					<description><![CDATA[<p>The extern keyword is used to tell the compiler that a data object is declared in a different *.cpp or *.c file. So there wont be any new memory is allocated for these variables. Check the below example and understand the working. //file1.cpp #include int x; extern void func2(); void func1(void) { x = x</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c-faq/what-is-the-use-of-extern-in-cc/">What is the use of extern in c/c++?</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>The extern keyword is used to tell the compiler that a data object is declared in a different *.cpp or *.c file. So there wont be any new memory is allocated for these variables. Check the below example and understand the working.</p>
<pre lang="cpp">
//file1.cpp
#include <iostream.h>

int x;
extern void func2();

void func1(void)
{
        x = x + 100;
        cout<<"x in func1 = "<< x << endl;
}

int main(void)
{
        x = 10;
        cout<<"x in main function = "<< x << endl;
        func1(); // calls func1 
        func2(); // calls func2 from file2
}
</pre>
<pre lang="cpp">
//file2.cpp
#include <iostream.h>
extern int x;
void func2(void)
{
        x = x + 300;
        cout<<"x in file2 = "<< x << endl;
}
</pre>
<p><strong>Output:</strong></p>
<blockquote><p>x in main function = 10<br />
x in func1 = 110<br />
x in file2 = 410</p></blockquote><p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c-faq/what-is-the-use-of-extern-in-cc/">What is the use of extern in c/c++?</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/what-is-the-use-of-extern-in-cc/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
