<?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>difference | Student Projects</title>
	<atom:link href="https://studentprojects.in/tag/difference/feed/" rel="self" type="application/rss+xml" />
	<link>https://studentprojects.in</link>
	<description>Microcontroller projects, Circuit Diagrams, Project Ideas</description>
	<lastBuildDate>Thu, 01 Sep 2011 14:19:47 +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 differnce between Structure and Union?</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c-faq/differnce-structure-union/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c-faq/differnce-structure-union/#comments</comments>
		
		<dc:creator><![CDATA[Chitra]]></dc:creator>
		<pubDate>Thu, 01 Sep 2011 10:29:59 +0000</pubDate>
				<category><![CDATA[C Questions & Answers]]></category>
		<category><![CDATA[difference]]></category>
		<category><![CDATA[structure]]></category>
		<category><![CDATA[union]]></category>
		<category><![CDATA[sizeof strucure]]></category>
		<category><![CDATA[sizeof union]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=1806</guid>

					<description><![CDATA[<p>The difference between structure and union is, 1. The amount of memory required to store a structure variable is the sum of the size of all the members. On the other hand, in case of unions, the amount of memory required is always equal to that required by its largest member. 2. In case of</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c-faq/differnce-structure-union/">What is the differnce between Structure and Union?</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>The difference between structure and union is,<br />
1. The amount of memory required to store a structure variable is the sum of the size of all the members.<br />
On the other hand, in case of unions, the amount of memory required is always equal to that required by its largest member.</p>
<p>2. In case of structure, each member have their own memory space but In union, one block is used by all the member of the union.</p>
<p><strong>Detailed Example:</strong></p>
<pre lang="c" line="1">
struct stu
{
	char c;
	int l;
	float p;
};
</pre>
<pre lang="c" line="1">
union emp
{
	char c;
	int l;
	float p;
};
</pre>
<p><strong>In the above example size of the structure stu is 7 and size of union emp is 4. </strong></p><p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c-faq/differnce-structure-union/">What is the differnce between Structure and Union?</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/differnce-structure-union/feed/</wfw:commentRss>
			<slash:comments>6</slash:comments>
		
		
			</item>
		<item>
		<title>What is the difference between macro and function?</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c-faq/difference-macro-function/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c-faq/difference-macro-function/#comments</comments>
		
		<dc:creator><![CDATA[Chitra]]></dc:creator>
		<pubDate>Fri, 19 Aug 2011 10:02:40 +0000</pubDate>
				<category><![CDATA[C Questions & Answers]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[macro]]></category>
		<category><![CDATA[difference]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=1652</guid>

					<description><![CDATA[<p>Here are the differences between macro and function, 1.Macro consumes less time: When a function is called, arguments have to be passed to it, those arguments are accepted by corresponding dummy variables in the function. Then they are processed, and finally the function returns a value that is assigned to a variable (except for a</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c-faq/difference-macro-function/">What is the difference between macro and function?</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>Here are the differences between macro and function,<br />
<strong></strong></p>
<p><strong>1.Macro consumes less time:</strong><br />
<span> </span>When a function is called, arguments have to be passed to it, those arguments are accepted by corresponding dummy variables in the function. Then they are processed, and finally the function returns a value that is assigned to a variable (except for a void function). If a function is invoked number of times, the times add up, and compilation is delayed. On the other hand, the macro expansion had already taken place and replaced each occurrence of the macro in the source code before the source code starts compiling, so it requires no additional time to execute.<br />
<strong></strong></p>
<p><strong>2. Function consumes less memory</strong>:<br />
<span> </span>Prior to compilation, all the macro-presences are replaced by their corresponding macro expansions, which consumes considerable memory. On the other hand, even if a function is invoked 100 times, it still occupies the same space. Hence function consumes less memory.<br />
<strong></strong></p>
<p><strong>Example for Macro:</strong><br />
The following line defines the macro SUM, having two parameters a and b and the replacement tokens (a + b):</p>
<p>#define SUM(a,b) (a + b)</p>
<p>This definition would cause the preprocessor to change the following statements (if the statements appear after the previous definition):<br />
c = SUM(x,y);<br />
c = d * SUM(x,y);<br />
In the output of the preprocessor, these statements would appear as:<br />
c = (x + y);<br />
c = d * (x + y);<br />
<strong></strong></p>
<p><strong>Example for function:</strong><br />
In calling program function call would appear as,</p>
<p>c=SUM(x,y);</p>
<p>Where sum is the name of the function. And x, y are the arguments passed from calling program to called program.<br />
This statement will invoke the following function SUM. Hence x, y are copied to dummy variables a and b. And then function computes the sum and stores the value in c, which will be returned back to the calling program.</p>
<p>int sum(int a, int b)<br />
{<br />
int c;<br />
c=a+b;<br />
return c;<br />
}</p><p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c-faq/difference-macro-function/">What is the difference between macro and function?</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/difference-macro-function/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
	</channel>
</rss>
