<?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++ pointers &#8211; reference and dereference operators</title>
	<atom:link href="http://www.codingunit.com/cplusplus-tutorial-pointers-reference-and-dereference-operators/feed" rel="self" type="application/rss+xml" />
	<link>http://www.codingunit.com/cplusplus-tutorial-pointers-reference-and-dereference-operators</link>
	<description>CodingUnit is your online resource for learning to program. Tutorials on C, C++, PHP, Python, MySQL, Java, JQuery, Opengl, DirectX and much more!</description>
	<lastBuildDate>Mon, 06 Feb 2012 06:08:16 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
	<item>
		<title>By: joan</title>
		<link>http://www.codingunit.com/cplusplus-tutorial-pointers-reference-and-dereference-operators/comment-page-1#comment-3834</link>
		<dc:creator>joan</dc:creator>
		<pubDate>Sat, 08 Oct 2011 16:04:24 +0000</pubDate>
		<guid isPermaLink="false">http://localhost/?p=508#comment-3834</guid>
		<description>In the third box, when you write: 
ptr_p = &amp;x;

&quot;&amp;&quot; is not the &quot;reference&quot; operator, it&#039;s the &quot;address-of&quot; operator.
The &quot;reference&quot; operator does exists and is a different thing. It is when you declare, for example, a function taking a (const Foo&amp; f) as a parameter. Or if you write int&amp; y = x;

The fact that these are two very different operators that work in almost opposed ways has caused me much trouble in the past, and I assume it still confuses many people. 

In the first case (Foo* y = &amp;x;) it really returns a pointer, so for example you would use -&gt; notation to access members.
On the other hand, when used within the type (Foo&amp; y = x;), it means &quot;y&quot; can be treated as a value, and you can use . notation to access members, even though it&#039;s not the original variable.</description>
		<content:encoded><![CDATA[<p>In the third box, when you write:<br />
ptr_p = &amp;x;</p>
<p>&#8220;&amp;&#8221; is not the &#8220;reference&#8221; operator, it&#8217;s the &#8220;address-of&#8221; operator.<br />
The &#8220;reference&#8221; operator does exists and is a different thing. It is when you declare, for example, a function taking a (const Foo&amp; f) as a parameter. Or if you write int&amp; y = x;</p>
<p>The fact that these are two very different operators that work in almost opposed ways has caused me much trouble in the past, and I assume it still confuses many people. </p>
<p>In the first case (Foo* y = &amp;x;) it really returns a pointer, so for example you would use -&gt; notation to access members.<br />
On the other hand, when used within the type (Foo&amp; y = x;), it means &#8220;y&#8221; can be treated as a value, and you can use . notation to access members, even though it&#8217;s not the original variable.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sachin pune</title>
		<link>http://www.codingunit.com/cplusplus-tutorial-pointers-reference-and-dereference-operators/comment-page-1#comment-3726</link>
		<dc:creator>sachin pune</dc:creator>
		<pubDate>Tue, 23 Aug 2011 07:05:58 +0000</pubDate>
		<guid isPermaLink="false">http://localhost/?p=508#comment-3726</guid>
		<description>useful tutorial........</description>
		<content:encoded><![CDATA[<p>useful tutorial&#8230;&#8230;..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: memoona</title>
		<link>http://www.codingunit.com/cplusplus-tutorial-pointers-reference-and-dereference-operators/comment-page-1#comment-3341</link>
		<dc:creator>memoona</dc:creator>
		<pubDate>Thu, 31 Mar 2011 07:13:35 +0000</pubDate>
		<guid isPermaLink="false">http://localhost/?p=508#comment-3341</guid>
		<description>great tutorial.</description>
		<content:encoded><![CDATA[<p>great tutorial.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: preeti</title>
		<link>http://www.codingunit.com/cplusplus-tutorial-pointers-reference-and-dereference-operators/comment-page-1#comment-3259</link>
		<dc:creator>preeti</dc:creator>
		<pubDate>Sat, 26 Feb 2011 13:47:06 +0000</pubDate>
		<guid isPermaLink="false">http://localhost/?p=508#comment-3259</guid>
		<description>well done. nice job</description>
		<content:encoded><![CDATA[<p>well done. nice job</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: harsha</title>
		<link>http://www.codingunit.com/cplusplus-tutorial-pointers-reference-and-dereference-operators/comment-page-1#comment-1849</link>
		<dc:creator>harsha</dc:creator>
		<pubDate>Thu, 23 Sep 2010 23:35:42 +0000</pubDate>
		<guid isPermaLink="false">http://localhost/?p=508#comment-1849</guid>
		<description>covers important things in pointers. Thanks!</description>
		<content:encoded><![CDATA[<p>covers important things in pointers. Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: crazy</title>
		<link>http://www.codingunit.com/cplusplus-tutorial-pointers-reference-and-dereference-operators/comment-page-1#comment-1805</link>
		<dc:creator>crazy</dc:creator>
		<pubDate>Sun, 15 Aug 2010 07:33:30 +0000</pubDate>
		<guid isPermaLink="false">http://localhost/?p=508#comment-1805</guid>
		<description>Gr8 Tut, helped me a lot</description>
		<content:encoded><![CDATA[<p>Gr8 Tut, helped me a lot</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Uiop</title>
		<link>http://www.codingunit.com/cplusplus-tutorial-pointers-reference-and-dereference-operators/comment-page-1#comment-954</link>
		<dc:creator>Uiop</dc:creator>
		<pubDate>Tue, 01 Jun 2010 16:45:36 +0000</pubDate>
		<guid isPermaLink="false">http://localhost/?p=508#comment-954</guid>
		<description>Great tutorial, helped me a lot!</description>
		<content:encoded><![CDATA[<p>Great tutorial, helped me a lot!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ElNillus</title>
		<link>http://www.codingunit.com/cplusplus-tutorial-pointers-reference-and-dereference-operators/comment-page-1#comment-37</link>
		<dc:creator>ElNillus</dc:creator>
		<pubDate>Mon, 05 Oct 2009 07:52:44 +0000</pubDate>
		<guid isPermaLink="false">http://localhost/?p=508#comment-37</guid>
		<description>Excellent tutorial, as a java/c# coder I&#039;m trying to learn c++ and I had a hard time with the tutorials at cpp.com.

thanks and keep up the good work. :)</description>
		<content:encoded><![CDATA[<p>Excellent tutorial, as a java/c# coder I&#8217;m trying to learn c++ and I had a hard time with the tutorials at cpp.com.</p>
<p>thanks and keep up the good work. <img src='http://www.codingunit.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>

