<?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"
	>
<channel>
	<title>Comments on: 2.8 &#8212; Constants</title>
	<atom:link href="http://www.learncpp.com/cpp-tutorial/28-constants/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.learncpp.com/cpp-tutorial/28-constants/</link>
	<description></description>
	<pubDate>Sun, 20 Jul 2008 14:15:50 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: Alex</title>
		<link>http://www.learncpp.com/cpp-tutorial/28-constants/#comment-17910</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Sat, 31 May 2008 00:08:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=49#comment-17910</guid>
		<description>Const variables have the same scoping rules as normal variables.  If you declare them globally, they apply though the whole file.  If you declare them locally, they will die when they go out of scope.  The only difference is that the value of a const variable can't be changed after initialization.</description>
		<content:encoded><![CDATA[<p>Const variables have the same scoping rules as normal variables.  If you declare them globally, they apply though the whole file.  If you declare them locally, they will die when they go out of scope.  The only difference is that the value of a const variable can&#8217;t be changed after initialization.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ronnie</title>
		<link>http://www.learncpp.com/cpp-tutorial/28-constants/#comment-15716</link>
		<dc:creator>Ronnie</dc:creator>
		<pubDate>Sun, 11 May 2008 22:34:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=49#comment-15716</guid>
		<description>Did constants apply through the whole file? Or what? :S  I mean const values using the &lt;pre&gt;&lt;b&gt;const&lt;/b&gt;&lt;/pre&gt; keyword.</description>
		<content:encoded><![CDATA[<p>Did constants apply through the whole file? Or what? :S  I mean const values using the
<pre><b>const</b></pre>
<p> keyword.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Learn C++ - &#187; 2.7 &#8212; Chars</title>
		<link>http://www.learncpp.com/cpp-tutorial/28-constants/#comment-12633</link>
		<dc:creator>Learn C++ - &#187; 2.7 &#8212; Chars</dc:creator>
		<pubDate>Wed, 23 Apr 2008 02:30:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=49#comment-12633</guid>
		<description>[...] 2007      Prev/Next Posts   &#171; 2.6 &#8212; Boolean Values &#124; Home &#124; 2.8 &#8212; Constants &#187;     Saturday, June 9th, 2007 at 7:07 [...]</description>
		<content:encoded><![CDATA[<p>[...] 2007      Prev/Next Posts   &laquo; 2.6 &#8212; Boolean Values | Home | 2.8 &#8212; Constants &raquo;     Saturday, June 9th, 2007 at 7:07 [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Learn C++ - &#187; 2.9 &#8212; Hungarian Notation</title>
		<link>http://www.learncpp.com/cpp-tutorial/28-constants/#comment-12602</link>
		<dc:creator>Learn C++ - &#187; 2.9 &#8212; Hungarian Notation</dc:creator>
		<pubDate>Wed, 23 Apr 2008 01:47:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=49#comment-12602</guid>
		<description>[...] 2007      Prev/Next Posts   &#171; 2.8 &#8212; Constants &#124; Home &#124; 2.10 &#8212; Comprehensive quiz &#187;     Monday, June 11th, 2007 at 4:04 [...]</description>
		<content:encoded><![CDATA[<p>[...] 2007      Prev/Next Posts   &laquo; 2.8 &#8212; Constants | Home | 2.10 &#8212; Comprehensive quiz &raquo;     Monday, June 11th, 2007 at 4:04 [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://www.learncpp.com/cpp-tutorial/28-constants/#comment-11549</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Sat, 12 Apr 2008 22:21:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=49#comment-11549</guid>
		<description>Generally I only use the literal constant 0 -- anything else is either defined as a #define value, a const int, or an enum.</description>
		<content:encoded><![CDATA[<p>Generally I only use the literal constant 0 &#8212; anything else is either defined as a #define value, a const int, or an enum.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: free</title>
		<link>http://www.learncpp.com/cpp-tutorial/28-constants/#comment-11382</link>
		<dc:creator>free</dc:creator>
		<pubDate>Fri, 11 Apr 2008 01:57:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=49#comment-11382</guid>
		<description>Alex:

Ref.:  it is a good idea to try to avoid using literal constants that arenâ€™t 0 or 1.

So I should use only literal constants that are 0 or 1?Â¿?   As for above.</description>
		<content:encoded><![CDATA[<p>Alex:</p>
<p>Ref.:  it is a good idea to try to avoid using literal constants that arenâ€™t 0 or 1.</p>
<p>So I should use only literal constants that are 0 or 1?Â¿?   As for above.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://www.learncpp.com/cpp-tutorial/28-constants/#comment-6536</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Thu, 24 Jan 2008 16:38:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=49#comment-6536</guid>
		<description>If you use the number 6 instead of 5, you are using a different literal, not changing the value of a literal.  In other words, literals are constants because the symbol 5 always has the value 5.  You can't change the symbol 5 to the value 6, or any other number.</description>
		<content:encoded><![CDATA[<p>If you use the number 6 instead of 5, you are using a different literal, not changing the value of a literal.  In other words, literals are constants because the symbol 5 always has the value 5.  You can&#8217;t change the symbol 5 to the value 6, or any other number.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joey</title>
		<link>http://www.learncpp.com/cpp-tutorial/28-constants/#comment-6529</link>
		<dc:creator>Joey</dc:creator>
		<pubDate>Thu, 24 Jan 2008 14:07:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=49#comment-6529</guid>
		<description>Literal constants are literal numbers inserted into the code. They are constants because you canâ€™t change their values.

int x = 5; // 5 is a literal constant 

I don't understand this, you can change 5 to 6, how is it unchangable?</description>
		<content:encoded><![CDATA[<p>Literal constants are literal numbers inserted into the code. They are constants because you canâ€™t change their values.</p>
<p>int x = 5; // 5 is a literal constant </p>
<p>I don&#8217;t understand this, you can change 5 to 6, how is it unchangable?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://www.learncpp.com/cpp-tutorial/28-constants/#comment-5925</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Sat, 12 Jan 2008 19:06:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=49#comment-5925</guid>
		<description>You could #define nYenPerDollar in a header file, but as I mentioned in the tutorial, #define values don't show up in the debugger, which can make them hard to debug, especially if you code uses them heavily.  Since the concept of yen per dollar is a global concept (it's going to remain constant throughout the program) the fact that all #define values are global isn't much of a problem in this case.</description>
		<content:encoded><![CDATA[<p>You could #define nYenPerDollar in a header file, but as I mentioned in the tutorial, #define values don&#8217;t show up in the debugger, which can make them hard to debug, especially if you code uses them heavily.  Since the concept of yen per dollar is a global concept (it&#8217;s going to remain constant throughout the program) the fact that all #define values are global isn&#8217;t much of a problem in this case.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Skylark</title>
		<link>http://www.learncpp.com/cpp-tutorial/28-constants/#comment-5896</link>
		<dc:creator>Skylark</dc:creator>
		<pubDate>Sat, 12 Jan 2008 05:25:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=49#comment-5896</guid>
		<description>Could you not #define nYenPerDollar in a header file which is included in the main source code?

This would eliminate the inconvenience of having to search for its place of definition and would also prevent the confict you mentioned.

-- Just a thought. I'm completely new to C++ and object-oriented programming all together, just trying to get my head around how many different ways the same task can be completed in C++.

PS: I am loving this tutorial. I'm using it for m pre-University study. =D</description>
		<content:encoded><![CDATA[<p>Could you not #define nYenPerDollar in a header file which is included in the main source code?</p>
<p>This would eliminate the inconvenience of having to search for its place of definition and would also prevent the confict you mentioned.</p>
<p>&#8211; Just a thought. I&#8217;m completely new to C++ and object-oriented programming all together, just trying to get my head around how many different ways the same task can be completed in C++.</p>
<p>PS: I am loving this tutorial. I&#8217;m using it for m pre-University study. =D</p>
]]></content:encoded>
	</item>
</channel>
</rss>
