<?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: 6.7 &#8212; Introduction to pointers</title>
	<atom:link href="http://www.learncpp.com/cpp-tutorial/67-introduction-to-pointers/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.learncpp.com/cpp-tutorial/67-introduction-to-pointers/</link>
	<description></description>
	<lastBuildDate>Tue, 07 Feb 2012 12:30:29 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Shreevardhan</title>
		<link>http://www.learncpp.com/cpp-tutorial/67-introduction-to-pointers/comment-page-1/#comment-95537</link>
		<dc:creator>Shreevardhan</dc:creator>
		<pubDate>Wed, 08 Jun 2011 09:22:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/67-introduction-to-pointers/#comment-95537</guid>
		<description>No memory allocated.  That is why it crashes.</description>
		<content:encoded><![CDATA[<p>No memory allocated.  That is why it crashes.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: zingmars</title>
		<link>http://www.learncpp.com/cpp-tutorial/67-introduction-to-pointers/comment-page-1/#comment-95535</link>
		<dc:creator>zingmars</dc:creator>
		<pubDate>Wed, 08 Jun 2011 00:00:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/67-introduction-to-pointers/#comment-95535</guid>
		<description>Something must be wrong, because the first code in which you declare only one pointer crashes too.</description>
		<content:encoded><![CDATA[<p>Something must be wrong, because the first code in which you declare only one pointer crashes too.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: capitanui</title>
		<link>http://www.learncpp.com/cpp-tutorial/67-introduction-to-pointers/comment-page-1/#comment-95533</link>
		<dc:creator>capitanui</dc:creator>
		<pubDate>Tue, 07 Jun 2011 12:28:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/67-introduction-to-pointers/#comment-95533</guid>
		<description>I have a question ...i cannot understand something.
I have this simple code :

int *pValue;
*pValue = 4;
cout&lt;&lt;*pValue;

It&#039;s all ok..it prints 4;

I i declare another one my program crushes and i cannot understand why since is the same thing.

int *pValue, *nValue;

*pValue = 4;
*nValue = 5;

cout&lt;&lt;*pValue&lt;&lt;*nValue;</description>
		<content:encoded><![CDATA[<p>I have a question &#8230;i cannot understand something.<br />
I have this simple code :</p>
<p>int *pValue;<br />
*pValue = 4;<br />
cout&lt;&lt;*pValue;</p>
<p>It&#039;s all ok..it prints 4;</p>
<p>I i declare another one my program crushes and i cannot understand why since is the same thing.</p>
<p>int *pValue, *nValue;</p>
<p>*pValue = 4;<br />
*nValue = 5;</p>
<p>cout&lt;&lt;*pValue&lt;&lt;*nValue;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Getting Started with OpenFrameworks &#124; The choreography of color and code</title>
		<link>http://www.learncpp.com/cpp-tutorial/67-introduction-to-pointers/comment-page-1/#comment-95509</link>
		<dc:creator>Getting Started with OpenFrameworks &#124; The choreography of color and code</dc:creator>
		<pubDate>Tue, 31 May 2011 02:22:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/67-introduction-to-pointers/#comment-95509</guid>
		<description>[...] So within our ParticleEmitter declaration we&#8217;ve declared that we&#8217;re going to have an x and y value to position our emitter on the screen and a rotation value to rotate the emitter over time. We also declare three methods, setup, update, and draw that will define what our emitter will do every time the application cycles through a frame. Lastly we declare an Array called &#8220;p&#8221; that will store all of the Particles that are currently on the screen. The pointer syntax(*) that declares the &#8220;p&#8221; array is out of the scope of this article, however you can learn about pointers and how they work in C++ via this excellent tutorial here. [...]</description>
		<content:encoded><![CDATA[<p>[...] So within our ParticleEmitter declaration we&#8217;ve declared that we&#8217;re going to have an x and y value to position our emitter on the screen and a rotation value to rotate the emitter over time. We also declare three methods, setup, update, and draw that will define what our emitter will do every time the application cycles through a frame. Lastly we declare an Array called &#8220;p&#8221; that will store all of the Particles that are currently on the screen. The pointer syntax(*) that declares the &#8220;p&#8221; array is out of the scope of this article, however you can learn about pointers and how they work in C++ via this excellent tutorial here. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SWEngineer</title>
		<link>http://www.learncpp.com/cpp-tutorial/67-introduction-to-pointers/comment-page-1/#comment-95120</link>
		<dc:creator>SWEngineer</dc:creator>
		<pubDate>Sat, 22 Jan 2011 16:29:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/67-introduction-to-pointers/#comment-95120</guid>
		<description>Simple well explained tutorial.

Thanks a lot.</description>
		<content:encoded><![CDATA[<p>Simple well explained tutorial.</p>
<p>Thanks a lot.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: xian</title>
		<link>http://www.learncpp.com/cpp-tutorial/67-introduction-to-pointers/comment-page-1/#comment-91263</link>
		<dc:creator>xian</dc:creator>
		<pubDate>Thu, 02 Sep 2010 05:56:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/67-introduction-to-pointers/#comment-91263</guid>
		<description>This is a wonderful tutorial - the examples here clearly step through all possible pointer/pointed-to configurations.  Thanks so much!</description>
		<content:encoded><![CDATA[<p>This is a wonderful tutorial &#8211; the examples here clearly step through all possible pointer/pointed-to configurations.  Thanks so much!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: baldo</title>
		<link>http://www.learncpp.com/cpp-tutorial/67-introduction-to-pointers/comment-page-1/#comment-66268</link>
		<dc:creator>baldo</dc:creator>
		<pubDate>Fri, 14 Aug 2009 18:44:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/67-introduction-to-pointers/#comment-66268</guid>
		<description>00000000 is not the value. See this:
&lt;pre&gt;
cout &lt;&lt; &amp;pnPtr &lt;&lt; endl;  // will print the address of the pointer (0013FF60)
cout &lt;&lt; pnPtr &lt;&lt; endl;   // will print the address that the pointer points to (00000000)
cout &lt;&lt; *pnPtr &lt;&lt; endl;  // will print the value of the address that the pointer points to
&lt;/pre&gt;
Because the pointer is null, it is pointing to address 00000000. The address of the pointer is 0013FF60.</description>
		<content:encoded><![CDATA[<p>00000000 is not the value. See this:</p>
<pre>
cout &lt;&lt; &amp;pnPtr &lt;&lt; endl;  // will print the address of the pointer (0013FF60)
cout &lt;&lt; pnPtr &lt;&lt; endl;   // will print the address that the pointer points to (00000000)
cout &lt;&lt; *pnPtr &lt;&lt; endl;  // will print the value of the address that the pointer points to
</pre>
<p>Because the pointer is null, it is pointing to address 00000000. The address of the pointer is 0013FF60.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: baldo</title>
		<link>http://www.learncpp.com/cpp-tutorial/67-introduction-to-pointers/comment-page-1/#comment-66267</link>
		<dc:creator>baldo</dc:creator>
		<pubDate>Fri, 14 Aug 2009 18:35:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/67-introduction-to-pointers/#comment-66267</guid>
		<description>The if (pnPtr) test to see if the pointer is null. If it is a null pointer then the address it is pointing is 0 (false). If the pointer is allocated (not null) then pnPtr points to a address != 0 (which means true).</description>
		<content:encoded><![CDATA[<p>The if (pnPtr) test to see if the pointer is null. If it is a null pointer then the address it is pointing is 0 (false). If the pointer is allocated (not null) then pnPtr points to a address != 0 (which means true).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Simon Kazakov</title>
		<link>http://www.learncpp.com/cpp-tutorial/67-introduction-to-pointers/comment-page-1/#comment-61674</link>
		<dc:creator>Simon Kazakov</dc:creator>
		<pubDate>Sat, 30 May 2009 06:57:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/67-introduction-to-pointers/#comment-61674</guid>
		<description>The statement is okey. Assigning an address to a pointer means that u tell the pointer: &quot;Point to this address&quot;. This is done with the &quot;&amp;&quot;.
&lt;pre&gt; int a = 10;
int *ptr = &amp;a; 
// the * is not a dereference operator. It is a pointer declaration.&lt;!--formatted--&gt;&lt;/pre&gt;
U can change the value of the pointed object with &quot;*&quot;.
&lt;pre&gt; *ptr = 8; // changes a to 8 &lt;/pre&gt;

The pointer itself is a variable that has an address. It is impossible to have a variable at 0000 0000.</description>
		<content:encoded><![CDATA[<p>The statement is okey. Assigning an address to a pointer means that u tell the pointer: &#8220;Point to this address&#8221;. This is done with the &#8220;&amp;&#8221;.</p>
<pre> int a = 10;
int *ptr = &amp;a;
// the * is not a dereference operator. It is a pointer declaration.<!--formatted--></pre>
<p>U can change the value of the pointed object with &#8220;*&#8221;.</p>
<pre> *ptr = 8; // changes a to 8 </pre>
<p>The pointer itself is a variable that has an address. It is impossible to have a variable at 0000 0000.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hamza K</title>
		<link>http://www.learncpp.com/cpp-tutorial/67-introduction-to-pointers/comment-page-1/#comment-60614</link>
		<dc:creator>Hamza K</dc:creator>
		<pubDate>Wed, 13 May 2009 00:58:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/67-introduction-to-pointers/#comment-60614</guid>
		<description>I don&#039;t understand this statement, shouldn&#039;t it be the other way around?:

&lt;pre&gt; int *pnPtr = 0;  // assign address 0 to pnPtr &lt;/pre&gt;
&quot;Note that in the last example, the * is not a dereference operator. It is a pointer declaration. Thus we are assigning address 0 to pnPtr, not the value 0 to the variable that pnPtr points to.&quot;

When I use the following code:

&lt;pre&gt; int * pnPtr = 0;
cout &lt;&lt; &amp;pnPtr &lt;&lt; endl;
cout &lt;&lt; pnPtr &lt;&lt; endl; &lt;/pre&gt;

I get the output 
0013FF60
00000000

surely the address is 0013FF... and the value is 000? 

Many thanks for the tutorials though, they&#039;re amazing, you&#039;re a saint!</description>
		<content:encoded><![CDATA[<p>I don&#8217;t understand this statement, shouldn&#8217;t it be the other way around?:</p>
<pre> int *pnPtr = 0;  // assign address 0 to pnPtr </pre>
<p>&#8220;Note that in the last example, the * is not a dereference operator. It is a pointer declaration. Thus we are assigning address 0 to pnPtr, not the value 0 to the variable that pnPtr points to.&#8221;</p>
<p>When I use the following code:</p>
<pre> int * pnPtr = 0;
cout &lt;&lt; &amp;pnPtr &lt;&lt; endl;
cout &lt;&lt; pnPtr &lt;&lt; endl; </pre>
<p>I get the output<br />
0013FF60<br />
00000000</p>
<p>surely the address is 0013FF&#8230; and the value is 000? </p>
<p>Many thanks for the tutorials though, they&#8217;re amazing, you&#8217;re a saint!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

