<?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: C/C++ Pointer-Arithmetics</title>
	<atom:link href="http://www.nrtm.de/index.php/2009/02/17/cc-pointer-arithmetic/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.nrtm.de/index.php/2009/02/17/cc-pointer-arithmetic/</link>
	<description>never read the manual</description>
	<lastBuildDate>Thu, 26 Jan 2012 09:13:58 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: jupp</title>
		<link>http://www.nrtm.de/index.php/2009/02/17/cc-pointer-arithmetic/comment-page-1/#comment-14</link>
		<dc:creator>jupp</dc:creator>
		<pubDate>Wed, 18 Feb 2009 11:54:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.nrtm.de/?p=78#comment-14</guid>
		<description>I think both infos are disjunct. Robert&#039;s view is just a third way to do it.</description>
		<content:encoded><![CDATA[<p>I think both infos are disjunct. Robert&#8217;s view is just a third way to do it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Willi</title>
		<link>http://www.nrtm.de/index.php/2009/02/17/cc-pointer-arithmetic/comment-page-1/#comment-13</link>
		<dc:creator>Willi</dc:creator>
		<pubDate>Wed, 18 Feb 2009 09:45:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.nrtm.de/?p=78#comment-13</guid>
		<description>&lt;blockquote cite=&quot;#commentbody-12&quot;&gt;
&lt;strong&gt;&lt;a href=&quot;#comment-12&quot; rel=&quot;nofollow&quot;&gt;robert&lt;/a&gt; :&lt;/strong&gt;
&lt;p&gt;&lt;a href=&quot;#comment-11&quot; rel=&quot;nofollow&quot;&gt;@Willi&lt;/a&gt;&lt;br&gt;
him or me?&lt;/p&gt;
&lt;/blockquote&gt;
Right YOU are - robert alias &quot;java the hood&quot;</description>
		<content:encoded><![CDATA[<blockquote cite="#commentbody-12"><p>
<strong><a href="#comment-12" rel="nofollow">robert</a> :</strong></p>
<p><a href="#comment-11" rel="nofollow">@Willi</a><br />
him or me?</p>
</blockquote>
<p>Right YOU are &#8211; robert alias &#8220;java the hood&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: robert</title>
		<link>http://www.nrtm.de/index.php/2009/02/17/cc-pointer-arithmetic/comment-page-1/#comment-12</link>
		<dc:creator>robert</dc:creator>
		<pubDate>Wed, 18 Feb 2009 09:44:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.nrtm.de/?p=78#comment-12</guid>
		<description>&lt;a href=&quot;#comment-11&quot; rel=&quot;nofollow&quot;&gt;@Willi&lt;/a&gt; 
him or me?</description>
		<content:encoded><![CDATA[<p><a href="#comment-11" rel="nofollow">@Willi</a><br />
him or me?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Willi</title>
		<link>http://www.nrtm.de/index.php/2009/02/17/cc-pointer-arithmetic/comment-page-1/#comment-11</link>
		<dc:creator>Willi</dc:creator>
		<pubDate>Wed, 18 Feb 2009 09:27:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.nrtm.de/?p=78#comment-11</guid>
		<description>&lt;a href=&quot;#comment-10&quot; rel=&quot;nofollow&quot;&gt;@robert&lt;/a&gt; 
right he is, i think</description>
		<content:encoded><![CDATA[<p><a href="#comment-10" rel="nofollow">@robert</a><br />
right he is, i think</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: robert</title>
		<link>http://www.nrtm.de/index.php/2009/02/17/cc-pointer-arithmetic/comment-page-1/#comment-10</link>
		<dc:creator>robert</dc:creator>
		<pubDate>Wed, 18 Feb 2009 07:22:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.nrtm.de/?p=78#comment-10</guid>
		<description>Unfortunately this isn&#039;t correct hundred percently.

If you program C and define an N-dimensional !static! array, an one dimensional array will be used instead.

What I&#039;d say is that if you want to use an N-dimensional access to an array of values, you have to allocate the data in this way:

&lt;code&gt;
// a will be 2-dimensional 20x10
double** a=(double**)malloc(20*sizeof(double*));
for (i=0;i&lt;20;i++)
  a[i]=(double*)malloc(10*sizeof(double));
&lt;/code&gt;

Then you can access a in the 2-dim way a[i][j] instead of computing the index of your own a[i*10+j]. This on the other hand won&#039;t work any more.

If you&#039;d define the array statically without a malloc, you can use both
a[i][j] as well as a[i*10+j], since it&#039;s an one dimensional field internaly</description>
		<content:encoded><![CDATA[<p>Unfortunately this isn&#8217;t correct hundred percently.</p>
<p>If you program C and define an N-dimensional !static! array, an one dimensional array will be used instead.</p>
<p>What I&#8217;d say is that if you want to use an N-dimensional access to an array of values, you have to allocate the data in this way:</p>
<p><code><br />
// a will be 2-dimensional 20x10<br />
double** a=(double**)malloc(20*sizeof(double*));<br />
for (i=0;i&lt;20;i++)<br />
  a[i]=(double*)malloc(10*sizeof(double));<br />
</code></p>
<p>Then you can access a in the 2-dim way a[i][j] instead of computing the index of your own a[i*10+j]. This on the other hand won&#8217;t work any more.</p>
<p>If you&#8217;d define the array statically without a malloc, you can use both<br />
a[i][j] as well as a[i*10+j], since it&#8217;s an one dimensional field internaly</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jupp</title>
		<link>http://www.nrtm.de/index.php/2009/02/17/cc-pointer-arithmetic/comment-page-1/#comment-9</link>
		<dc:creator>jupp</dc:creator>
		<pubDate>Tue, 17 Feb 2009 20:31:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.nrtm.de/?p=78#comment-9</guid>
		<description>:)</description>
		<content:encoded><![CDATA[<p> <img src='http://www.nrtm.de/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: stefan</title>
		<link>http://www.nrtm.de/index.php/2009/02/17/cc-pointer-arithmetic/comment-page-1/#comment-8</link>
		<dc:creator>stefan</dc:creator>
		<pubDate>Tue, 17 Feb 2009 15:43:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.nrtm.de/?p=78#comment-8</guid>
		<description>&lt;a href=&quot;#comment-7&quot; rel=&quot;nofollow&quot;&gt;@stefan&lt;/a&gt; 
warning just if it&#039;s an array of char (string) in C...so just forget ;)</description>
		<content:encoded><![CDATA[<p><a href="#comment-7" rel="nofollow">@stefan</a><br />
warning just if it&#8217;s an array of char (string) in C&#8230;so just forget <img src='http://www.nrtm.de/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: stefan</title>
		<link>http://www.nrtm.de/index.php/2009/02/17/cc-pointer-arithmetic/comment-page-1/#comment-7</link>
		<dc:creator>stefan</dc:creator>
		<pubDate>Tue, 17 Feb 2009 15:37:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.nrtm.de/?p=78#comment-7</guid>
		<description>won&#039;t this raise a compiler warning? I think I remember something about this...</description>
		<content:encoded><![CDATA[<p>won&#8217;t this raise a compiler warning? I think I remember something about this&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>

