<?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: 1.10 &#8212; A first look at the preprocessor</title>
	<atom:link href="http://www.learncpp.com/cpp-tutorial/110-a-first-look-at-the-preprocessor/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.learncpp.com/cpp-tutorial/110-a-first-look-at-the-preprocessor/</link>
	<description></description>
	<pubDate>Thu, 24 Jul 2008 16:21:43 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: Joyel</title>
		<link>http://www.learncpp.com/cpp-tutorial/110-a-first-look-at-the-preprocessor/#comment-19956</link>
		<dc:creator>Joyel</dc:creator>
		<pubDate>Sat, 28 Jun 2008 05:42:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=33#comment-19956</guid>
		<description>Ok the coding you provided for the header guard is going to be VERY helpful. Thanks for that.</description>
		<content:encoded><![CDATA[<p>Ok the coding you provided for the header guard is going to be VERY helpful. Thanks for that.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: weirdolino</title>
		<link>http://www.learncpp.com/cpp-tutorial/110-a-first-look-at-the-preprocessor/#comment-19438</link>
		<dc:creator>weirdolino</dc:creator>
		<pubDate>Fri, 20 Jun 2008 17:50:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=33#comment-19438</guid>
		<description>Hi, just wanted to point out a little (somewhat misleading) mistake in the page. Close to the top, where you explain the two forms of the #include command the first form should be &#38;ltfilename&#38;rt. It doesn't display filename at all, at least in my browser (opera), since it's in angle brackets instead of escape codes and the browser thinks it's supposed to be an html tag.

Awesome tutorial, the best i've read so far. Thanks a lot for sharing your knowledge.

[ Fixed.  Thanks for letting me know.  -Alex ]</description>
		<content:encoded><![CDATA[<p>Hi, just wanted to point out a little (somewhat misleading) mistake in the page. Close to the top, where you explain the two forms of the #include command the first form should be &amp;ltfilename&amp;rt. It doesn&#8217;t display filename at all, at least in my browser (opera), since it&#8217;s in angle brackets instead of escape codes and the browser thinks it&#8217;s supposed to be an html tag.</p>
<p>Awesome tutorial, the best i&#8217;ve read so far. Thanks a lot for sharing your knowledge.</p>
<p>[ Fixed.  Thanks for letting me know.  -Alex ]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://www.learncpp.com/cpp-tutorial/110-a-first-look-at-the-preprocessor/#comment-14373</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Mon, 05 May 2008 00:30:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=33#comment-14373</guid>
		<description>Personally I don't think there is any reason to use #define this way.

The only place I use #defines is when #defining symbols to use with #ifdef or #ifndef.  You can't use regular variables for those.</description>
		<content:encoded><![CDATA[<p>Personally I don&#8217;t think there is any reason to use #define this way.</p>
<p>The only place I use #defines is when #defining symbols to use with #ifdef or #ifndef.  You can&#8217;t use regular variables for those.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David</title>
		<link>http://www.learncpp.com/cpp-tutorial/110-a-first-look-at-the-preprocessor/#comment-14329</link>
		<dc:creator>David</dc:creator>
		<pubDate>Sun, 04 May 2008 17:46:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=33#comment-14329</guid>
		<description>I have a quick question... what is the benefit of using define as opposed to simply initilializing the variable?

What is the difference between  

&lt;pre&gt;#define COLUMNS_PER_PAGE  122&lt;/pre&gt; 
and
&lt;pre&gt;int COLUMNS_PER_PAGE = 122 &lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>I have a quick question&#8230; what is the benefit of using define as opposed to simply initilializing the variable?</p>
<p>What is the difference between  </p>
<pre>#define COLUMNS_PER_PAGE  122</pre>
<p>and</p>
<pre>int COLUMNS_PER_PAGE = 122 </pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Learn C++ - &#187; 1.11 &#8212; Comprehensive quiz</title>
		<link>http://www.learncpp.com/cpp-tutorial/110-a-first-look-at-the-preprocessor/#comment-12593</link>
		<dc:creator>Learn C++ - &#187; 1.11 &#8212; Comprehensive quiz</dc:creator>
		<pubDate>Wed, 23 Apr 2008 01:40:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=33#comment-12593</guid>
		<description>[...] 2007      Prev/Next Posts   &#171; 1.10 &#8212; A first look at the preprocessor &#124; Home &#124; News &#8212; New site functionality &#187;     Sunday, June 3rd, 2007 at 1:01 [...]</description>
		<content:encoded><![CDATA[<p>[...] 2007      Prev/Next Posts   &laquo; 1.10 &#8212; A first look at the preprocessor | Home | News &#8212; New site functionality &raquo;     Sunday, June 3rd, 2007 at 1:01 [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Abhishek</title>
		<link>http://www.learncpp.com/cpp-tutorial/110-a-first-look-at-the-preprocessor/#comment-5585</link>
		<dc:creator>Abhishek</dc:creator>
		<pubDate>Sun, 06 Jan 2008 05:11:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=33#comment-5585</guid>
		<description>Great!</description>
		<content:encoded><![CDATA[<p>Great!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://www.learncpp.com/cpp-tutorial/110-a-first-look-at-the-preprocessor/#comment-4867</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Mon, 24 Dec 2007 04:38:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=33#comment-4867</guid>
		<description>Billerr, You can use such defines for several reasons.  Header guards are the primary one.  However, it can be useful to define code that only executes when certain #defines have been set.  For example, you might do something like this:

&lt;pre&gt;
#ifdef _DEBUG
cout &lt;&lt; nDebugVariable &lt;&lt; endl;
#endif
&lt;/pre&gt;

This would only print out nDebugVariable if the program was compiled with the _DEBUG symbol #defined.  You might turn this symbol on when compiling a version for development or testing, but turn it off for the release version.

In a game I wrote, I used a #define to toggle whether the game generated random dungeons (for the release version) or a special debug level (for testing/development).  I could toggle between the two by commenting/uncommenting the #define and recompiling.</description>
		<content:encoded><![CDATA[<p>Billerr, You can use such defines for several reasons.  Header guards are the primary one.  However, it can be useful to define code that only executes when certain #defines have been set.  For example, you might do something like this:</p>
<pre>
#ifdef _DEBUG
cout < < nDebugVariable << endl;
#endif
</pre>
<p>This would only print out nDebugVariable if the program was compiled with the _DEBUG symbol #defined.  You might turn this symbol on when compiling a version for development or testing, but turn it off for the release version.</p>
<p>In a game I wrote, I used a #define to toggle whether the game generated random dungeons (for the release version) or a special debug level (for testing/development).  I could toggle between the two by commenting/uncommenting the #define and recompiling.</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jason</title>
		<link>http://www.learncpp.com/cpp-tutorial/110-a-first-look-at-the-preprocessor/#comment-4855</link>
		<dc:creator>Jason</dc:creator>
		<pubDate>Sun, 23 Dec 2007 20:28:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=33#comment-4855</guid>
		<description>I'm not absolutely sure but from what I've read here and a book I have, I believe you are correct about it only being for the header guards when there is no replacement.</description>
		<content:encoded><![CDATA[<p>I&#8217;m not absolutely sure but from what I&#8217;ve read here and a book I have, I believe you are correct about it only being for the header guards when there is no replacement.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: billerr</title>
		<link>http://www.learncpp.com/cpp-tutorial/110-a-first-look-at-the-preprocessor/#comment-4851</link>
		<dc:creator>billerr</dc:creator>
		<pubDate>Sun, 23 Dec 2007 18:48:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=33#comment-4851</guid>
		<description>This might be a dumb question, but what exactly is the purpose of:

&lt;code&gt;#define [identifier]&lt;/code&gt;

i.e. a #define without any replacement?

Is it useful mostly in header guards?</description>
		<content:encoded><![CDATA[<p>This might be a dumb question, but what exactly is the purpose of:</p>
<p><code>#define [identifier]</code></p>
<p>i.e. a #define without any replacement?</p>
<p>Is it useful mostly in header guards?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://www.learncpp.com/cpp-tutorial/110-a-first-look-at-the-preprocessor/#comment-4374</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Fri, 14 Dec 2007 04:15:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=33#comment-4374</guid>
		<description>GovZ, as far as I know, that is an official part of the preprocessor.  You should also be able to use &#038;&#038; to test whether multiple symbols are defined at the same time:

#if defined (symbol_a) &#038;&#038; defined (symbol_b)

I didn't cover these specific concepts in this tutorial because I don't even cover what the &#124;&#124; and &#038;&#038; symbols mean until section 3.6.  This is just supposed to be a quick introduction, not a full preprocessor tutorial. :)

There are quite a few other neat things the preprocessor can do that I don't (and don't plan to) cover in this tutorial.  If you are interested in learning more, there are quite a few preprocessor documents that are publicly available.  &lt;a href="http://developer.apple.com/documentation/DeveloperTools/gcc-4.0.1/cpp/index.html" rel="nofollow"&gt;Here's one&lt;/a&gt;.</description>
		<content:encoded><![CDATA[<p>GovZ, as far as I know, that is an official part of the preprocessor.  You should also be able to use &#038;&#038; to test whether multiple symbols are defined at the same time:</p>
<p>#if defined (symbol_a) &#038;&#038; defined (symbol_b)</p>
<p>I didn&#8217;t cover these specific concepts in this tutorial because I don&#8217;t even cover what the || and &#038;&#038; symbols mean until section 3.6.  This is just supposed to be a quick introduction, not a full preprocessor tutorial. :)</p>
<p>There are quite a few other neat things the preprocessor can do that I don&#8217;t (and don&#8217;t plan to) cover in this tutorial.  If you are interested in learning more, there are quite a few preprocessor documents that are publicly available.  <a href="http://developer.apple.com/documentation/DeveloperTools/gcc-4.0.1/cpp/index.html" rel="nofollow">Here&#8217;s one</a>.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
