<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Datastructures</title>
	<atom:link href="http://datastructuresnc.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://datastructuresnc.wordpress.com</link>
	<description>..........internal structure of the data</description>
	<lastBuildDate>Mon, 29 Jun 2009 21:51:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='datastructuresnc.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Datastructures</title>
		<link>http://datastructuresnc.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://datastructuresnc.wordpress.com/osd.xml" title="Datastructures" />
	<atom:link rel='hub' href='http://datastructuresnc.wordpress.com/?pushpress=hub'/>
		<item>
		<title>accessing the portion of array which is not initialised</title>
		<link>http://datastructuresnc.wordpress.com/2009/06/29/accessing-the-portion-of-array-which-is-not-initialised/</link>
		<comments>http://datastructuresnc.wordpress.com/2009/06/29/accessing-the-portion-of-array-which-is-not-initialised/#comments</comments>
		<pubDate>Mon, 29 Jun 2009 21:45:08 +0000</pubDate>
		<dc:creator>ajitb4u</dc:creator>
				<category><![CDATA[arrays]]></category>
		<category><![CDATA[garbage value]]></category>
		<category><![CDATA[invalid location]]></category>
		<category><![CDATA[partially intialiazed arrays]]></category>
		<category><![CDATA[segmentation fault]]></category>

		<guid isPermaLink="false">http://datastructuresnc.wordpress.com/?p=41</guid>
		<description><![CDATA[hey guys we may encountering the situations where we notice that an array of a particular size is declared and initialised and when we access its out of bound values may of us will be in the dilemma what will happen. consider example:- int a[6]={1,2}; here values of the arrays are a[0]=1; a[1]=2; a[2]=0; a[3]=0; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=datastructuresnc.wordpress.com&amp;blog=8231835&amp;post=41&amp;subd=datastructuresnc&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>hey guys  we may encountering the situations where we notice that an array of a particular size is declared and initialised and when we access its out of bound values may of us will be in the dilemma what will happen.</p>
<p>consider example:-</p>
<p>int a[6]={1,2};</p>
<p>here values of the arrays are</p>
<p>a[0]=1;<br />
a[1]=2;<br />
a[2]=0;<br />
a[3]=0;<br />
a[4]=0;<br />
a[5]=0;</p>
<p>in the partially initialized arrays values of the arrays which are not initialized will be 0&#8242;s</p>
<p>now coming to point what i want to say is</p>
<p>1)if suppose if we print the a[6] or a[7]&#8230;  if they are the valid locations , values stored in that locations will be printed otherwise garbage values will be printed.<br />
2)if we want to store something  in those location i.e if we try to give a[6]=7 etc  then we are actually trying to access an invalid location.<br />
which will lead to segmentation faults.</p>
<p>important note :-standard compilers which follows the ansi standards will produce the above results.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/datastructuresnc.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/datastructuresnc.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/datastructuresnc.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/datastructuresnc.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/datastructuresnc.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/datastructuresnc.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/datastructuresnc.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/datastructuresnc.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/datastructuresnc.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/datastructuresnc.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/datastructuresnc.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/datastructuresnc.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/datastructuresnc.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/datastructuresnc.wordpress.com/41/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=datastructuresnc.wordpress.com&amp;blog=8231835&amp;post=41&amp;subd=datastructuresnc&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://datastructuresnc.wordpress.com/2009/06/29/accessing-the-portion-of-array-which-is-not-initialised/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/606f6afbf0a151f6c065cb2002a19e35?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ajitb4u</media:title>
		</media:content>
	</item>
		<item>
		<title>observe the output of the program</title>
		<link>http://datastructuresnc.wordpress.com/2009/06/26/observe-the-output-of-the-program/</link>
		<comments>http://datastructuresnc.wordpress.com/2009/06/26/observe-the-output-of-the-program/#comments</comments>
		<pubDate>Fri, 26 Jun 2009 16:11:16 +0000</pubDate>
		<dc:creator>ajitb4u</dc:creator>
				<category><![CDATA[arrays]]></category>
		<category><![CDATA[returning address]]></category>

		<guid isPermaLink="false">http://datastructuresnc.wordpress.com/?p=33</guid>
		<description><![CDATA[#include&#8221;stdio.h&#8221; int a[]={1,2,3}; int main() { int *f(void); *f()=5; printf(&#8220;%d %d %d&#8221;,a[0],a[1],a[2]); } int * f(void) { int i; for(i=0;i&#60;3;i++) return a+i; } o/p:- 5 2 3 reason:&#8211; at i=0 in loop function is returned and it returns starting address of a whose value is eventually changed to 5.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=datastructuresnc.wordpress.com&amp;blog=8231835&amp;post=33&amp;subd=datastructuresnc&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>#include&#8221;stdio.h&#8221;<br />
int a[]={1,2,3};<br />
int main()<br />
{<br />
	int *f(void);<br />
	*f()=5;<br />
	printf(&#8220;%d %d %d&#8221;,a[0],a[1],a[2]);<br />
}<br />
int * f(void)<br />
{<br />
	int i;<br />
	for(i=0;i&lt;3;i++)<br />
		return a+i;<br />
}</p>
<p>o/p:-</p>
<p>5 2 3</p>
<p>reason:&#8211; at i=0 in loop function is returned and it returns starting address of a whose value is eventually changed to 5.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/datastructuresnc.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/datastructuresnc.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/datastructuresnc.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/datastructuresnc.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/datastructuresnc.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/datastructuresnc.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/datastructuresnc.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/datastructuresnc.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/datastructuresnc.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/datastructuresnc.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/datastructuresnc.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/datastructuresnc.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/datastructuresnc.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/datastructuresnc.wordpress.com/33/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=datastructuresnc.wordpress.com&amp;blog=8231835&amp;post=33&amp;subd=datastructuresnc&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://datastructuresnc.wordpress.com/2009/06/26/observe-the-output-of-the-program/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/606f6afbf0a151f6c065cb2002a19e35?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ajitb4u</media:title>
		</media:content>
	</item>
		<item>
		<title>reversing an array of strings</title>
		<link>http://datastructuresnc.wordpress.com/2009/06/24/reversing-an-array-of-strings/</link>
		<comments>http://datastructuresnc.wordpress.com/2009/06/24/reversing-an-array-of-strings/#comments</comments>
		<pubDate>Wed, 24 Jun 2009 16:38:29 +0000</pubDate>
		<dc:creator>ajitb4u</dc:creator>
				<category><![CDATA[arrays]]></category>
		<category><![CDATA[reverse array]]></category>
		<category><![CDATA[reverse string]]></category>

		<guid isPermaLink="false">http://datastructuresnc.wordpress.com/?p=31</guid>
		<description><![CDATA[/*************************************/ example:- i/p:- hello how are you o/p:- you are how hello /*************************************/ #include&#8221;stdio.h&#8221; #include&#8221;string.h&#8221; int main() { char p[100],c; int len,i,j; printf(&#8220;enter the text that you want to be reversed:&#8221;); gets(p); len=strlen(p); for(i=0;i&#60;len/2;i++) { c=p[i]; p[i]=p[len-i-1]; p[len-i-1]=c; } i=0; while(i&#60;len) { j=i; for(j=i;j&#60;len;j++) { if(p[j]==32) break; } j&#8211;; for(;i&#60;j;) { c=p[i]; p[i]=p[j]; p[j]=c; j&#8211;; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=datastructuresnc.wordpress.com&amp;blog=8231835&amp;post=31&amp;subd=datastructuresnc&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>/*************************************/<br />
example:-<br />
                    i/p:-   hello how are you</p>
<p>                    o/p:- you are how hello</p>
<p>/*************************************/</p>
<p>#include&#8221;stdio.h&#8221;<br />
#include&#8221;string.h&#8221;<br />
int main()<br />
{<br />
	char p[100],c;<br />
	int len,i,j;<br />
	printf(&#8220;enter the text that you want to be reversed:&#8221;);<br />
	gets(p);<br />
	len=strlen(p);<br />
	for(i=0;i&lt;len/2;i++)<br />
	{<br />
		c=p[i];<br />
		p[i]=p[len-i-1];<br />
		p[len-i-1]=c;<br />
	}<br />
	i=0;<br />
	while(i&lt;len)<br />
	{<br />
		j=i;<br />
		for(j=i;j&lt;len;j++)<br />
		{<br />
			if(p[j]==32)<br />
				break;<br />
		}<br />
		j&#8211;;<br />
		for(;i&lt;j;)<br />
		{<br />
			c=p[i];<br />
			p[i]=p[j];<br />
			p[j]=c;<br />
			j&#8211;;<br />
			i++;<br />
		}<br />
		while(i&lt;len)<br />
		{<br />
			i++;<br />
			if(p[i]==32)<br />
				break;<br />
			if(i==len-1)<br />
				break;<br />
		}<br />
		i++;<br />
		j=i;<br />
	}<br />
	puts(p);<br />
} </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/datastructuresnc.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/datastructuresnc.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/datastructuresnc.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/datastructuresnc.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/datastructuresnc.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/datastructuresnc.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/datastructuresnc.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/datastructuresnc.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/datastructuresnc.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/datastructuresnc.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/datastructuresnc.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/datastructuresnc.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/datastructuresnc.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/datastructuresnc.wordpress.com/31/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=datastructuresnc.wordpress.com&amp;blog=8231835&amp;post=31&amp;subd=datastructuresnc&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://datastructuresnc.wordpress.com/2009/06/24/reversing-an-array-of-strings/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/606f6afbf0a151f6c065cb2002a19e35?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ajitb4u</media:title>
		</media:content>
	</item>
		<item>
		<title>accessing the array</title>
		<link>http://datastructuresnc.wordpress.com/2009/06/22/accessing-the-array/</link>
		<comments>http://datastructuresnc.wordpress.com/2009/06/22/accessing-the-array/#comments</comments>
		<pubDate>Mon, 22 Jun 2009 06:33:10 +0000</pubDate>
		<dc:creator>ajitb4u</dc:creator>
				<category><![CDATA[arrays]]></category>
		<category><![CDATA[access array]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[pointer]]></category>

		<guid isPermaLink="false">http://datastructuresnc.wordpress.com/?p=20</guid>
		<description><![CDATA[consider the following int a[4]={1,2,3,4} what i want say is if you want to access the array i mean if you want to retrieve the elements we will write if as a[i] where i={0,1,2,3} but we can write the same as i[a]; for example a[0] == 0[a]; a[1] == 1[a]; a[2] == 2[a]; as i [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=datastructuresnc.wordpress.com&amp;blog=8231835&amp;post=20&amp;subd=datastructuresnc&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>consider the following</p>
<p>int a[4]={1,2,3,4}</p>
<p>what i want say is</p>
<p>if you want to access the array i mean if you want to retrieve the elements we will write if as a[i]  where i={0,1,2,3}</p>
<p>but we can write the same as i[a];</p>
<p>for example</p>
<p>a[0] == 0[a];<br />
a[1] == 1[a];<br />
a[2] == 2[a];</p>
<p>as i already posted in the previous posts a[i] is internally understood by the compiler as the pointer value at *(a+i)</p>
<p>so even if we write i[a] it will be interpreted as *(i+a);</p>
<p>so both convey the same location</p>
<p>thus when we write</p>
<p>printf(&#8220;%d  %d &#8220;,a[i],i[a]);</p>
<p>we get the same answer. <strong></strong></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/datastructuresnc.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/datastructuresnc.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/datastructuresnc.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/datastructuresnc.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/datastructuresnc.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/datastructuresnc.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/datastructuresnc.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/datastructuresnc.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/datastructuresnc.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/datastructuresnc.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/datastructuresnc.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/datastructuresnc.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/datastructuresnc.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/datastructuresnc.wordpress.com/20/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=datastructuresnc.wordpress.com&amp;blog=8231835&amp;post=20&amp;subd=datastructuresnc&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://datastructuresnc.wordpress.com/2009/06/22/accessing-the-array/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/606f6afbf0a151f6c065cb2002a19e35?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ajitb4u</media:title>
		</media:content>
	</item>
		<item>
		<title>2D array structure and some points related to arrays</title>
		<link>http://datastructuresnc.wordpress.com/2009/06/20/2d-array-structure-and-some-points-related-to-arrays/</link>
		<comments>http://datastructuresnc.wordpress.com/2009/06/20/2d-array-structure-and-some-points-related-to-arrays/#comments</comments>
		<pubDate>Sat, 20 Jun 2009 15:13:35 +0000</pubDate>
		<dc:creator>ajitb4u</dc:creator>
				<category><![CDATA[arrays]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[array structure]]></category>
		<category><![CDATA[two dimensional arrays]]></category>

		<guid isPermaLink="false">http://datastructuresnc.wordpress.com/?p=15</guid>
		<description><![CDATA[1) if an array is declared and only some of its elements are initialized then all the remaining elements of it are initialized to &#8217;0&#8242; by default. example: int a[5]={1,2,3}; a[0]=1; a[1]=2; a[2]=3; a[3]=0; // initialized to &#8217;0&#8242; by default a[4]=0; i.e in an partially initialized arrays all the elements that are not initialized their [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=datastructuresnc.wordpress.com&amp;blog=8231835&amp;post=15&amp;subd=datastructuresnc&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>1)  if an array is declared and only some of its elements are initialized then all the remaining elements of it are initialized to &#8217;0&#8242; by default.</p>
<p>example:</p>
<p>int a[5]={1,2,3};</p>
<p>a[0]=1;<br />
a[1]=2;<br />
a[2]=3;<br />
a[3]=0;     //  initialized to &#8217;0&#8242; by default<br />
a[4]=0;</p>
<p>i.e in an partially initialized arrays all the elements that are not initialized their values will be &#8217;0&#8242;<strong>.</p>
<p>2D arrays:</strong><strong><strong></p>
<p>consider the following</p>
<p>int a[2][3];</p>
<p>here a memory of 6 elements is created and &#8216;a&#8217; will be pointing to first row and &#8216;a+1&#8242; will be pointing to  second row . if you want to access first element notations are<br />
a[0][0]  ==&gt; **a</p>
<p>similarly</p>
<p>**(a+1)  == a[1][0];</p>
<p>to be clear with is concept</p>
<p>int a[5][4][7];</p>
<p>**(*(a+2)+1)   ==&gt;  a[2][1][0];</p>
<p>assuming for the above int  a[5][4][7] size of int 4 bytes and starting address of &#8216;a&#8217; is at 2000<br />
&amp;a+1  ==&gt;  2560  i.e 2000+5*4*7*(size of int i.e 4)</p>
<p>observe the following  </strong><strong></strong></p>
<p>int a[2][3];</p>
<p>*(a+1) == *a+3 i.e second row first element address</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/datastructuresnc.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/datastructuresnc.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/datastructuresnc.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/datastructuresnc.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/datastructuresnc.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/datastructuresnc.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/datastructuresnc.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/datastructuresnc.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/datastructuresnc.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/datastructuresnc.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/datastructuresnc.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/datastructuresnc.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/datastructuresnc.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/datastructuresnc.wordpress.com/15/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=datastructuresnc.wordpress.com&amp;blog=8231835&amp;post=15&amp;subd=datastructuresnc&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://datastructuresnc.wordpress.com/2009/06/20/2d-array-structure-and-some-points-related-to-arrays/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/606f6afbf0a151f6c065cb2002a19e35?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ajitb4u</media:title>
		</media:content>
	</item>
		<item>
		<title>arrays &#8212; sizes</title>
		<link>http://datastructuresnc.wordpress.com/2009/06/19/arrays-sizes/</link>
		<comments>http://datastructuresnc.wordpress.com/2009/06/19/arrays-sizes/#comments</comments>
		<pubDate>Fri, 19 Jun 2009 20:29:06 +0000</pubDate>
		<dc:creator>ajitb4u</dc:creator>
				<category><![CDATA[arrays]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[arraysize]]></category>

		<guid isPermaLink="false">http://datastructuresnc.wordpress.com/?p=11</guid>
		<description><![CDATA[here we are going to  see what are the sizes of the arrays that are intialized, declared. consider the following: assumption: 1)size of int is 4 bytes 2)starting address of a is 2000 int a[10]; when given sizeof(a) gives 10*4 = 40 as answer. i have already said in previous post that a denotes starting [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=datastructuresnc.wordpress.com&amp;blog=8231835&amp;post=11&amp;subd=datastructuresnc&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>here we are going to  see what are the sizes of the arrays that are intialized, declared.</p>
<p>consider the following:</p>
<p>assumption:</p>
<p>1)size of int is 4 bytes</p>
<p>2)starting address of a is 2000</p>
<p>int a[10];</p>
<p>when given sizeof(a) gives 10*4 = 40 as answer.</p>
<p>i have already said in previous post that a denotes starting address of the memory in the stacksegment.  here what i want to say is size of and address are the two operators where when we give a is taken as whole array and not the the starting element address.</p>
<p>example:</p>
<p>&amp;a+1  gives the location 2040 i.e memory next to total memory occupied by &#8216;a&#8217;.</p>
<p>when you give &#8216;a+1&#8242;  it gives you address of second element in the array.</p>
<p>when you give &#8216;a&#8217; it gives address of address of first element in array.</p>
<p>conclusion:</p>
<p>1)so sizeof and address are two exceptions where when you give a it will be taken as entire array .</p>
<p>2) internally at all the places &#8216;a&#8217; means pointer pointing to the first memory address of the array.</p>
<p>here is the small example to describe above</p>
<p>#include&#8221;stdio.h&#8221;<br />
int main()<br />
{<br />
	int a[10];<br />
	printf(&#8220;%d %d %d %d&#8221;,&amp;a,&amp;a+1,a,a+1);<br />
	return 0;<br />
}</p>
<p>O/p:-  assuming starting address of a is at 2000</p>
<p>2000 2040 2000 2004.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/datastructuresnc.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/datastructuresnc.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/datastructuresnc.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/datastructuresnc.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/datastructuresnc.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/datastructuresnc.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/datastructuresnc.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/datastructuresnc.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/datastructuresnc.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/datastructuresnc.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/datastructuresnc.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/datastructuresnc.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/datastructuresnc.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/datastructuresnc.wordpress.com/11/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=datastructuresnc.wordpress.com&amp;blog=8231835&amp;post=11&amp;subd=datastructuresnc&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://datastructuresnc.wordpress.com/2009/06/19/arrays-sizes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/606f6afbf0a151f6c065cb2002a19e35?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ajitb4u</media:title>
		</media:content>
	</item>
		<item>
		<title>small notes on array</title>
		<link>http://datastructuresnc.wordpress.com/2009/06/18/small-notes-on-array/</link>
		<comments>http://datastructuresnc.wordpress.com/2009/06/18/small-notes-on-array/#comments</comments>
		<pubDate>Thu, 18 Jun 2009 18:29:24 +0000</pubDate>
		<dc:creator>ajitb4u</dc:creator>
				<category><![CDATA[arrays]]></category>
		<category><![CDATA[array]]></category>

		<guid isPermaLink="false">http://datastructuresnc.wordpress.com/?p=4</guid>
		<description><![CDATA[array may be simply defined as collection of data of same types. array and pointers are very much related when u intilize an array memory is created in the stacksegment and the name with which array is created will be pointing to the first element of that memory. example a[10]  =&#62; array of 10 elements [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=datastructuresnc.wordpress.com&amp;blog=8231835&amp;post=4&amp;subd=datastructuresnc&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>array may be simply defined as collection of data of same types.</p>
<p>array and pointers are very much related</p>
<p>when u intilize an array memory is created in the stacksegment and the name with which array is created will be pointing to the first element of that memory.</p>
<p>example a[10]  =&gt; array of 10 elements is created in the stack segment and &#8216;a&#8217; will pointing to the first element of that memory.</p>
<p>when u read the data element a[i]  it will be internally undetstood by the compiler as *(a+i)  =&gt; value at( address of a + no of elemnts after which i is located multipled by the size of that data type ).</p>
<p>ex: a[10] is an array  assume starting address of a is at 2000 and size of int is 4 bytes the</p>
<p>a[3] denotes *(a+3)  =&gt;  value at( 2000(address of a) + 3*4 ) =&gt;  value  at address 2012.</p>
<p>a small code to explain the above concept</p>
<p>#include&lt;stdio.h&gt;<br />
int main()<br />
{<br />
void temp(int);<br />
void perm(int *);<br />
void permarray(int []);<br />
int a[]={9,8,7};<br />
temp(a[1]);//here value of a[1] is passed<br />
printf(&#8220;\n %d %d %d \n&#8221;,a[0],a[1],a[2]);<br />
perm(&amp;a[2]);//address of a[1] is passed<br />
printf(&#8220;\n %d %d %d \n&#8221;,a[0],a[1],a[2]);<br />
permarray(a);// array is passed :: actually address of a[0] is passed<br />
printf(&#8220;\n %d %d %d \n&#8221;,a[0],a[1],a[2]);<br />
return 0;<br />
}<br />
void temp(int x)// creates a variable x and chages its value to 5<br />
{<br />
x=5;<br />
return;<br />
}<br />
void perm(int *p)//takes the adderess of a[2] changes its value at that address to 10<br />
{<br />
printf(&#8220;\n  look at the passing argument in the main and the recevin argument in function &#8220;);<br />
printf(&#8220;\n editing the value of the third elemnent :&#8221;);<br />
*p=10;<br />
return;<br />
}<br />
void permarray(int *x)// takes the address of the first variable of the array as the argument<br />
{<br />
printf(&#8220;\n look how array is passed and how it is received in fnc:&#8221;);<br />
//  look at the assignments statements<br />
*x=1;<br />
*(x+1)=2;<br />
x[2]=3;<br />
return;;<br />
}</p>
<p>o/p:</p>
<p>9 8 7</p>
<p>look at the passing argument in the main and the recevin argument in function<br />
editing the value of the third elemnent :<br />
9 8 10</p>
<p>look how array is passed and how it is received in fnc:<br />
1 2 3</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/datastructuresnc.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/datastructuresnc.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/datastructuresnc.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/datastructuresnc.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/datastructuresnc.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/datastructuresnc.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/datastructuresnc.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/datastructuresnc.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/datastructuresnc.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/datastructuresnc.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/datastructuresnc.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/datastructuresnc.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/datastructuresnc.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/datastructuresnc.wordpress.com/4/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=datastructuresnc.wordpress.com&amp;blog=8231835&amp;post=4&amp;subd=datastructuresnc&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://datastructuresnc.wordpress.com/2009/06/18/small-notes-on-array/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/606f6afbf0a151f6c065cb2002a19e35?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ajitb4u</media:title>
		</media:content>
	</item>
	</channel>
</rss>
