<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: 2.6 &#8212; Boolean Values</title>
	<atom:link href="http://www.learncpp.com/cpp-tutorial/26-boolean-values/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.learncpp.com/cpp-tutorial/26-boolean-values/</link>
	<description></description>
	<lastBuildDate>Wed, 08 Sep 2010 10:51:27 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: gurbux</title>
		<link>http://www.learncpp.com/cpp-tutorial/26-boolean-values/comment-page-1/#comment-87221</link>
		<dc:creator>gurbux</dc:creator>
		<pubDate>Sat, 26 Jun 2010 15:51:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=42#comment-87221</guid>
		<description>hey nice explanation alex very helpfull...........</description>
		<content:encoded><![CDATA[<p>hey nice explanation alex very helpfull&#8230;&#8230;&#8230;..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: joha</title>
		<link>http://www.learncpp.com/cpp-tutorial/26-boolean-values/comment-page-1/#comment-87003</link>
		<dc:creator>joha</dc:creator>
		<pubDate>Wed, 23 Jun 2010 00:16:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=42#comment-87003</guid>
		<description>wouldnt it be the same to put instead of x==y, this: x=y????
i tried and got the same result so.....what is the difference and when do I use each operator????

Thanks..</description>
		<content:encoded><![CDATA[<p>wouldnt it be the same to put instead of x==y, this: x=y????<br />
i tried and got the same result so&#8230;..what is the difference and when do I use each operator????</p>
<p>Thanks..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bertha</title>
		<link>http://www.learncpp.com/cpp-tutorial/26-boolean-values/comment-page-1/#comment-84261</link>
		<dc:creator>Bertha</dc:creator>
		<pubDate>Fri, 07 May 2010 00:21:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=42#comment-84261</guid>
		<description>&lt;a href=&quot;http://www.streamgirls18.com&quot; rel=&quot;nofollow&quot;&gt;stream sex&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p><a href="http://www.streamgirls18.com" rel="nofollow">stream sex</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Guntis</title>
		<link>http://www.learncpp.com/cpp-tutorial/26-boolean-values/comment-page-1/#comment-81564</link>
		<dc:creator>Guntis</dc:creator>
		<pubDate>Thu, 25 Mar 2010 16:22:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=42#comment-81564</guid>
		<description>Yay, I think I completely understand how bool works now.
Thanks Alex, this is so much better than even some of those books on cpp.

P.S. Here&#039;s my little test that succeeded btw.
&lt;pre&gt;
bool isEqual(int x, int y)
{
	return (x == y);
}
int main()
{
	cout &lt;&lt; &quot;Enter a value:\t\t &quot;;
	int x;
	cin &gt;&gt; x;

	cout &lt;&lt; &quot;Enter another value:\t &quot;;
	int y;
	cin &gt;&gt; y;

	if (isEqual(x, y))
		cout &lt;&lt; &quot;Numbers were equal!&quot; &lt;&lt; endl;
	else
		cout &lt;&lt; &quot;Numbers were not equal&quot; &lt;&lt; endl;

	bool bZero(1);

	if (x == 0)
		bZero = 1;
	else 
		if (y == 0)
			bZero = 1;
		else 
			bZero = 0;
	
	if (bZero == 1)
		cout &lt;&lt; &quot;One of numbers was 0&quot; &lt;&lt; endl;
	else 
		return 0;
	

}
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Yay, I think I completely understand how bool works now.<br />
Thanks Alex, this is so much better than even some of those books on cpp.</p>
<p>P.S. Here&#8217;s my little test that succeeded btw.</p>
<pre>
bool isEqual(int x, int y)
{
	return (x == y);
}
int main()
{
	cout &lt;&lt; &quot;Enter a value:\t\t &quot;;
	int x;
	cin &gt;&gt; x;

	cout &lt;&lt; &quot;Enter another value:\t &quot;;
	int y;
	cin &gt;&gt; y;

	if (isEqual(x, y))
		cout &lt;&lt; &quot;Numbers were equal!&quot; &lt;&lt; endl;
	else
		cout &lt;&lt; &quot;Numbers were not equal&quot; &lt;&lt; endl;

	bool bZero(1);

	if (x == 0)
		bZero = 1;
	else
		if (y == 0)
			bZero = 1;
		else
			bZero = 0;

	if (bZero == 1)
		cout &lt;&lt; &quot;One of numbers was 0&quot; &lt;&lt; endl;
	else
		return 0;

}
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mac</title>
		<link>http://www.learncpp.com/cpp-tutorial/26-boolean-values/comment-page-1/#comment-81474</link>
		<dc:creator>Mac</dc:creator>
		<pubDate>Thu, 25 Mar 2010 02:42:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=42#comment-81474</guid>
		<description>Hi, i tried to make this program work with three numbers:

i.e.
return (x == y == z)

the program compiled fine and ran, but did only gave the result for &quot;else&quot; (false)

after i took away &quot;int z&quot; it worked just fine...

does bool only work for two variables?</description>
		<content:encoded><![CDATA[<p>Hi, i tried to make this program work with three numbers:</p>
<p>i.e.<br />
return (x == y == z)</p>
<p>the program compiled fine and ran, but did only gave the result for &#8220;else&#8221; (false)</p>
<p>after i took away &#8220;int z&#8221; it worked just fine&#8230;</p>
<p>does bool only work for two variables?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stephan</title>
		<link>http://www.learncpp.com/cpp-tutorial/26-boolean-values/comment-page-1/#comment-80588</link>
		<dc:creator>Stephan</dc:creator>
		<pubDate>Mon, 15 Mar 2010 10:00:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=42#comment-80588</guid>
		<description>Hi Alex (Admin)!

Great site. 
Just wanted to say that I find your site extremely educational, and for me, easy to follow. Good work!

P.S.
I get just as much fun/learning reading the comments at the end of the tutorial as I do from the lessons. I can&#039;t finish a section &lt;em&gt;without&lt;/em&gt; reading the comments!

Brilliant!!!</description>
		<content:encoded><![CDATA[<p>Hi Alex (Admin)!</p>
<p>Great site.<br />
Just wanted to say that I find your site extremely educational, and for me, easy to follow. Good work!</p>
<p>P.S.<br />
I get just as much fun/learning reading the comments at the end of the tutorial as I do from the lessons. I can&#8217;t finish a section <em>without</em> reading the comments!</p>
<p>Brilliant!!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dawit</title>
		<link>http://www.learncpp.com/cpp-tutorial/26-boolean-values/comment-page-1/#comment-76491</link>
		<dc:creator>dawit</dc:creator>
		<pubDate>Fri, 15 Jan 2010 11:47:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=42#comment-76491</guid>
		<description>wath is break;</description>
		<content:encoded><![CDATA[<p>wath is break;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel</title>
		<link>http://www.learncpp.com/cpp-tutorial/26-boolean-values/comment-page-1/#comment-71044</link>
		<dc:creator>Daniel</dc:creator>
		<pubDate>Mon, 26 Oct 2009 08:35:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=42#comment-71044</guid>
		<description>I&#039;ve never seen that type of assignment used for a built-in, although I do not doubt that it works. I believe that &quot;int i = 1;&quot; uses int&#039;s default constructor THEN uses int&#039;s assignment operator. Whereas &quot;int j(1);&quot; uses a version of int&#039;s constructor which accepts an integer. In theory the second should be more efficient although compilers are most likely smart enough to optimise away the extra step.</description>
		<content:encoded><![CDATA[<p>I&#8217;ve never seen that type of assignment used for a built-in, although I do not doubt that it works. I believe that &#8220;int i = 1;&#8221; uses int&#8217;s default constructor THEN uses int&#8217;s assignment operator. Whereas &#8220;int j(1);&#8221; uses a version of int&#8217;s constructor which accepts an integer. In theory the second should be more efficient although compilers are most likely smart enough to optimise away the extra step.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Collin</title>
		<link>http://www.learncpp.com/cpp-tutorial/26-boolean-values/comment-page-1/#comment-71001</link>
		<dc:creator>Collin</dc:creator>
		<pubDate>Sun, 25 Oct 2009 15:57:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=42#comment-71001</guid>
		<description>the if statement calls the function to check if (x==y)
	
&lt;pre&gt;
if (IsEqual(x, y))
cout &lt;&lt; x &lt;&lt; &quot; and &quot; &lt;&lt; y &lt;&lt; &quot; are equal&quot;&lt;&lt;endl;
else
cout &lt;&lt; x &lt;&lt; &quot; and &quot; &lt;&lt; y &lt;&lt; &quot; are not equal&quot;&lt;&lt;endl;
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>the if statement calls the function to check if (x==y)</p>
<pre>
if (IsEqual(x, y))
cout &lt;&lt; x &lt;&lt; &quot; and &quot; &lt;&lt; y &lt;&lt; &quot; are equal&quot;&lt;&lt;endl;
else
cout &lt;&lt; x &lt;&lt; &quot; and &quot; &lt;&lt; y &lt;&lt; &quot; are not equal&quot;&lt;&lt;endl;
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://www.learncpp.com/cpp-tutorial/26-boolean-values/comment-page-1/#comment-67532</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Mon, 31 Aug 2009 10:24:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=42#comment-67532</guid>
		<description>Could someone please give me a definitive answer about the difference between explicit and implicit assignments.

&lt;pre&gt;

int i = 1;
int j(1);

&lt;/pre&gt;

Thanks</description>
		<content:encoded><![CDATA[<p>Could someone please give me a definitive answer about the difference between explicit and implicit assignments.</p>
<pre>

int i = 1;
int j(1);
</pre>
<p>Thanks</p>
]]></content:encoded>
	</item>
</channel>
</rss>
