<?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: error in realloc</title>
	<atom:link href="https://www.emblogic.com/blog/03/error-in-realloc/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.emblogic.com/blog/03/error-in-realloc/</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: shiv</title>
		<link>https://www.emblogic.com/blog/03/error-in-realloc/#comment-3794</link>
		<dc:creator><![CDATA[shiv]]></dc:creator>
		<pubDate>Thu, 07 Mar 2013 05:04:15 +0000</pubDate>
		<guid isPermaLink="false">http://emblogic.org/blog/?p=6244#comment-3794</guid>
		<description><![CDATA[First of all, if you are using a charactre pointer :

char ch, *ma;

ch = fgetc(fp_test);
*ma = ch;

Here you need to allocate memory of char size to ma.

Second thing, the above mention line for fgetc is not required before the for loop, because, it&#039;s being called twice before going into the &#039;for&#039; statement body execution.
for(k = 1; (ch = fgetc(fp_test)) != EOF;)]]></description>
		<content:encoded><![CDATA[<p>First of all, if you are using a charactre pointer :</p>
<p>char ch, *ma;</p>
<p>ch = fgetc(fp_test);<br />
*ma = ch;</p>
<p>Here you need to allocate memory of char size to ma.</p>
<p>Second thing, the above mention line for fgetc is not required before the for loop, because, it&#8217;s being called twice before going into the &#8216;for&#8217; statement body execution.<br />
for(k = 1; (ch = fgetc(fp_test)) != EOF;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ganesh Kale</title>
		<link>https://www.emblogic.com/blog/03/error-in-realloc/#comment-3783</link>
		<dc:creator><![CDATA[Ganesh Kale]]></dc:creator>
		<pubDate>Sun, 03 Mar 2013 14:50:46 +0000</pubDate>
		<guid isPermaLink="false">http://emblogic.org/blog/?p=6244#comment-3783</guid>
		<description><![CDATA[use a temporary variable to strore the count of allocated memory. 
initialize temp to how much memory allocated during maloc.

temp = temp+1;
ma = realloc(ma, temp);

Good Luck.........]]></description>
		<content:encoded><![CDATA[<p>use a temporary variable to strore the count of allocated memory.<br />
initialize temp to how much memory allocated during maloc.</p>
<p>temp = temp+1;<br />
ma = realloc(ma, temp);</p>
<p>Good Luck&#8230;&#8230;&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>
