<?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>Zero Intellect &#187; Negation</title>
	<atom:link href="http://www.zerointellect.com/tag/negation/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.zerointellect.com</link>
	<description>Technology Blog requiring Zero Intellect to follow !!!</description>
	<lastBuildDate>Mon, 28 Jun 2010 14:09:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>C++ Logical Negation Operator</title>
		<link>http://www.zerointellect.com/programming/c-logical-negation-operator/</link>
		<comments>http://www.zerointellect.com/programming/c-logical-negation-operator/#comments</comments>
		<pubDate>Wed, 25 Nov 2009 08:48:16 +0000</pubDate>
		<dc:creator>zrydento</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[data type]]></category>
		<category><![CDATA[Logical]]></category>
		<category><![CDATA[Negation]]></category>
		<category><![CDATA[Operator]]></category>
		<category><![CDATA[scalar]]></category>

		<guid isPermaLink="false">http://www.zerointellect.com/?p=85</guid>
		<description><![CDATA[<p> </p>
<p>The logical negation operator ! [exclamation] used in C++ and many other languages. However the return value of the operator is overlooked by many people.</p>
<p> </p>
<p>The syntax of the operator follows is</p>
<p> </p>
<p>! cast-expression</p>
<p> </p>
<p>Where, the cast-expression operand must be of scalar type (returning only a single value, not multiple values like an array)</p>
<p> </p>
<p>The result is of type int <p>Continue reading <a href="http://www.zerointellect.com/programming/c-logical-negation-operator/">C++ Logical Negation Operator</a></p>]]></description>
			<content:encoded><![CDATA[<p> </p>
<p>The logical negation operator <strong>!</strong> [exclamation] used in C++ and many other languages. However the return value of the operator is overlooked by many people.</p>
<p> </p>
<p>The syntax of the operator follows is</p>
<p> </p>
<blockquote><p><strong>! cast-expression</strong></p></blockquote>
<p> </p>
<p>Where, the cast-expression operand must be of scalar type (returning only a single value, not multiple values like an array)</p>
<p> </p>
<p>The result is of type int and is the logical negation of the operand:</p>
<p> </p>
<blockquote><p> <strong>0 if the operand is nonzero</strong></p>
<p><strong> 1 if the operand is zero</strong></p></blockquote>
<p> </p>
<p>To demonstrate the usage of the Logical Negation Operator, the simple program below was written</p>
<p> </p>
<blockquote><p><strong># include &lt;iostream.h&gt;</strong></p>
<p><strong># include &lt;conio.h&gt;</strong></p>
<p><strong> </strong></p>
<p><strong>void main()</strong></p>
<p><strong>{</strong></p>
<p><strong>   clrscr();</strong></p>
<p><strong> </strong></p>
<p><strong>   cout&lt;&lt;&#8221;\nThe expression !0 equals : &#8220;&lt;&lt;!0;</strong></p>
<p><strong>   cout&lt;&lt;&#8221;\nThe expression !0.7 equals : &#8220;&lt;&lt;!0.54;</strong></p>
<p><strong>   cout&lt;&lt;&#8221;\nThe expression !4 equals : &#8220;&lt;&lt;!4;</strong></p>
<p><strong>   cout&lt;&lt;&#8221;\nThe expression !-4 equals : &#8220;&lt;&lt;!-4;</strong></p>
<p><strong> </strong></p>
<p><strong>   getch();</strong></p>
<p><strong>}</strong></p></blockquote>
<p> </p>
<p> The output of the program is an integer value as expected, the negation of the value 0 (Zero) is equal to 1 and the negation operator applied anything else is equal to 0 (Zero)</p>
<p> </p>
<blockquote><p> <strong>The expression !0 equals : 1</strong></p>
<p><strong>The expression !0.7 equals : 0</strong></p>
<p><strong>The expression !4 equals : 0</strong></p>
<p><strong>The expression !-4 equals : 0</strong></p></blockquote>
<p> </p>
<p> To summarize, the things to note are that the return type of the operator is int (integer) and the cast-expression operand must be of scalar type</p>
<p> </p>
<p>Happy Coding</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zerointellect.com/programming/c-logical-negation-operator/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

