<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Visual C++ Tips &#187; macro</title>
	<atom:link href="http://weseetips.com/tag/macro/feed/" rel="self" type="application/rss+xml" />
	<link>http://weseetips.com</link>
	<description>Gold mine of Visual C++ tricks!</description>
	<lastBuildDate>Thu, 11 Mar 2010 09:09:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Trailing spaces after backslash delimiter &#8211; Programmers nightmare.</title>
		<link>http://weseetips.com/2008/03/31/trailing-spaces-after-backslash-delimiter-programmers-nightmare/</link>
		<comments>http://weseetips.com/2008/03/31/trailing-spaces-after-backslash-delimiter-programmers-nightmare/#comments</comments>
		<pubDate>Mon, 31 Mar 2008 17:58:34 +0000</pubDate>
		<dc:creator>Jijo Raj</dc:creator>
				<category><![CDATA[Codeproject]]></category>
		<category><![CDATA[Debugging Tips]]></category>
		<category><![CDATA[backslash]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[Debugging]]></category>
		<category><![CDATA[delimiter]]></category>
		<category><![CDATA[macro]]></category>
		<category><![CDATA[VC++]]></category>
		<category><![CDATA[Visual C++]]></category>

		<guid isPermaLink="false">http://weseetips.wordpress.com/?p=52</guid>
		<description><![CDATA[Usually we used to have spaces after semi columns. Since C++ ignore whitespace, its not a problem. But in Visual C++ 6.0 that is not the case always. If you put spaces after the backslash delimiter(\), it will become one of the worst bugs that you encounter. Usually we use backslash delimiter to concatenate lines [...]]]></description>
			<content:encoded><![CDATA[<p><a title="Icon How Can I Do It?" href="http://weseetips.wordpress.com/files/2008/03/icon_howcanidoit.jpg"></a><a title="advancedseries.jpg" href="http://weseetips.wordpress.com/files/2008/03/advancedseries.jpg"></a><img src="http://weseetips.wordpress.com/files/2008/03/icon_description.jpg" alt="Icon Description" /><br />
Usually we used to have spaces after semi columns. Since C++ ignore whitespace, its not a problem. But in Visual C++ 6.0 that is not the case always. If you put spaces after the backslash delimiter(\), it will become one of the worst bugs that you encounter.</p>
<p><img src="http://weseetips.wordpress.com/files/2008/03/icon_underthehood.jpg" alt="icon_underthehood.jpg" /><br />
Usually we use backslash delimiter to concatenate lines &#8211; mostly while writing macros. See the following macro.</p>
<pre>#define INCREMENT_AND_DECREMENT( Value ) \
    Value = Value + 1; \ <span style="color:#ff0000;">» » »</span>
    Value = Value - 1;</pre>
<p>In the macro, instead of <span style="color:#ff0000;">»</span> char, put some tab or space and then compile. You will get a strange error as follows.</p>
<pre>error C2501: 'Value' : missing storage-class or type specifiers</pre>
<p><img src="http://weseetips.wordpress.com/files/2008/03/icon_howcanidoit.jpg" alt="Icon How Can I Do It?" /><br />
One of the defensive mechanism is &#8211; always enable &#8220;View whitespace&#8221; by pressing <strong>Ctrl+Shift+8</strong>. So take care next time and don&#8217;t spend hrs on these silly bugs as I did years before.</p>
<p><img class="alignnone size-medium wp-image-18" src="http://weseetips.wordpress.com/files/2008/03/icon_note.jpg?w=94" alt="" width="94" height="32" /><br />
Note that its <span style="color:#0000ff;">just a implementation behavior in Visual C++ 6.0 </span>and <span style="text-decoration:underline;"><strong>may not</strong></span> found in other compilers or upcoming Visual C++ versions.</p>
<p>Thanks to <strong>Hemant</strong> for pointing out my implicit biasing towards VisualStudio 6.0. I forgot to specify that its just a Visual studio behavior.</p>
<p><img src="http://weseetips.wordpress.com/files/2008/03/intermediateseries.jpg" alt="intermediateseries.jpg" /><br />
Targeted Audience &#8211; Intermediate.</p>
]]></content:encoded>
			<wfw:commentRss>http://weseetips.com/2008/03/31/trailing-spaces-after-backslash-delimiter-programmers-nightmare/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

