<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
	
	>
<channel>
	<title>Comments on: Some important things about segments&#8230;</title>
	<atom:link href="https://www.emblogic.com/blog/03/some-important-things-about-segments/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.emblogic.com/blog/03/some-important-things-about-segments/</link>
	<description>Embedded System and ARM Training</description>
	<lastBuildDate>Mon, 07 Oct 2013 04:00:03 +0000</lastBuildDate>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.9.1</generator>
	<item>
		<title>By: nitin sharma</title>
		<link>https://www.emblogic.com/blog/03/some-important-things-about-segments/#comment-741</link>
		<dc:creator><![CDATA[nitin sharma]]></dc:creator>
		<pubDate>Sat, 28 Apr 2012 07:36:55 +0000</pubDate>
		<guid isPermaLink="false">http://emblogic.org/blog/?p=2257#comment-741</guid>
		<description><![CDATA[hi manoj,
&lt;b&gt;all the functions&lt;/b&gt; are allocated memory in &lt;b&gt;text segment&lt;/b&gt; not in the data segment. only global and static variabls are allowed to be stored in data segment. The variable of functions are stored in stack.]]></description>
		<content:encoded><![CDATA[<p>hi manoj,<br />
<b>all the functions</b> are allocated memory in <b>text segment</b> not in the data segment. only global and static variabls are allowed to be stored in data segment. The variable of functions are stored in stack.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: manoj</title>
		<link>https://www.emblogic.com/blog/03/some-important-things-about-segments/#comment-688</link>
		<dc:creator><![CDATA[manoj]]></dc:creator>
		<pubDate>Thu, 29 Mar 2012 05:20:08 +0000</pubDate>
		<guid isPermaLink="false">http://emblogic.org/blog/?p=2257#comment-688</guid>
		<description><![CDATA[thanx Gaurav..]]></description>
		<content:encoded><![CDATA[<p>thanx Gaurav..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: gaurav sharma</title>
		<link>https://www.emblogic.com/blog/03/some-important-things-about-segments/#comment-684</link>
		<dc:creator><![CDATA[gaurav sharma]]></dc:creator>
		<pubDate>Tue, 27 Mar 2012 14:29:01 +0000</pubDate>
		<guid isPermaLink="false">http://emblogic.org/blog/?p=2257#comment-684</guid>
		<description><![CDATA[also the memory allocated by malloc is heap ...because memory in heap remains till we free it explicitly a program to depict the usefullness of malloc
int* func()
{
     int i;i=10;
     return(&amp;i); 
}
int main()
{
   int* ptr;
   ptr=func();
   printf(&quot;%d&quot;,*ptr);
}when we execute this program it gives a warning ...reason being when we are returning the address of i from func then i is a local variable of func which vanishes after func exits ....thus the pointer in the main function becomes a bad pointer that is not pointing towards anything...but if we use int* ptr=(int*)malloc(sizeof(int))
and then use return(ptr); and then dereference the ptr pointer in main we will not get any warning because the memory in heap remains]]></description>
		<content:encoded><![CDATA[<p>also the memory allocated by malloc is heap &#8230;because memory in heap remains till we free it explicitly a program to depict the usefullness of malloc<br />
int* func()<br />
{<br />
     int i;i=10;<br />
     return(&amp;i);<br />
}<br />
int main()<br />
{<br />
   int* ptr;<br />
   ptr=func();<br />
   printf(&#8220;%d&#8221;,*ptr);<br />
}when we execute this program it gives a warning &#8230;reason being when we are returning the address of i from func then i is a local variable of func which vanishes after func exits &#8230;.thus the pointer in the main function becomes a bad pointer that is not pointing towards anything&#8230;but if we use int* ptr=(int*)malloc(sizeof(int))<br />
and then use return(ptr); and then dereference the ptr pointer in main we will not get any warning because the memory in heap remains</p>
]]></content:encoded>
	</item>
</channel>
</rss>
