<?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>Randomly Intermittent Thoughts &#187; C/C++</title>
	<atom:link href="http://www.nathanblomquist.net/blog/category/programming/cc/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.nathanblomquist.net/blog</link>
	<description>Thoughts I have pondered, but may not be wholely original...</description>
	<lastBuildDate>Mon, 15 Mar 2010 18:32:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Who Knew XOR Was So Hard?</title>
		<link>http://www.nathanblomquist.net/blog/2009/07/29/who-knew-xor-was-so-hard/</link>
		<comments>http://www.nathanblomquist.net/blog/2009/07/29/who-knew-xor-was-so-hard/#comments</comments>
		<pubDate>Wed, 29 Jul 2009 16:27:11 +0000</pubDate>
		<dc:creator>nblom</dc:creator>
				<category><![CDATA[C/C++]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.nathanblomquist.net/blog/?p=35</guid>
		<description><![CDATA[XOR in C++ http://www.codeguru.com/forum/archive/index.php/t-179920.html http://bytes.com/groups/c/215986-why-isnt-there-logical-xor-operator Final Recommendation: PLAIN TEXT C: // 'a' and 'b' are some sort of integer type. // the double NOTs coerce to a standard boolean type // (compiler dependent) !!a ^ !!b Thankfully Java is easier http://www.sap-img.com/java/java-boolean-logical-operators.htm PLAIN TEXT JAVA: // 'a' and 'b' are of boolean type // yay, no [...]]]></description>
			<content:encoded><![CDATA[<p>XOR in C++</p>
<ul>
<li><a href="http://www.codeguru.com/forum/archive/index.php/t-179920.html">http://www.codeguru.com/forum/archive/index.php/t-179920.html</a></li>
<li><a href="http://bytes.com/groups/c/215986-why-isnt-there-logical-xor-operator">http://bytes.com/groups/c/215986-why-isnt-there-logical-xor-operator</a></li>
</ul>
<p>Final Recommendation:</p>
<div class="igBar"><span id="lc-3"><a href="#" onclick="javascript:showPlainTxt('c-3'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">C:</span>
<div id="c-3">
<div class="c">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// 'a' and 'b' are some sort of integer type.</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// the double NOTs coerce to a standard boolean type</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// (compiler dependent)</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">!!a ^ !!b </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Thankfully Java is easier<br />
<a href="http://www.sap-img.com/java/java-boolean-logical-operators.htm">http://www.sap-img.com/java/java-boolean-logical-operators.htm</a></p>
<div class="igBar"><span id="ljava-4"><a href="#" onclick="javascript:showPlainTxt('java-4'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">JAVA:</span>
<div id="java-4">
<div class="java">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// 'a' and 'b' are of boolean type</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// yay, no coercion necessary!</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">a ^ b </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>I didn’t know that the ^ operator was overloaded to handle Booleans, until I needed it a few weeks ago.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nathanblomquist.net/blog/2009/07/29/who-knew-xor-was-so-hard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
