<?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: 3.4 &#8212; Sizeof, comma, and arithmetic if operators</title>
	<atom:link href="http://www.learncpp.com/cpp-tutorial/34-sizeof-comma-and-arithmetic-if-operators/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.learncpp.com/cpp-tutorial/34-sizeof-comma-and-arithmetic-if-operators/</link>
	<description></description>
	<lastBuildDate>Tue, 07 Feb 2012 12:30:29 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: bacia</title>
		<link>http://www.learncpp.com/cpp-tutorial/34-sizeof-comma-and-arithmetic-if-operators/comment-page-1/#comment-96545</link>
		<dc:creator>bacia</dc:creator>
		<pubDate>Sun, 04 Dec 2011 12:09:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/34-sizeof-comma-and-arithmetic-if-operators/#comment-96545</guid>
		<description>return x, y;

would this only return y?</description>
		<content:encoded><![CDATA[<p>return x, y;</p>
<p>would this only return y?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bla</title>
		<link>http://www.learncpp.com/cpp-tutorial/34-sizeof-comma-and-arithmetic-if-operators/comment-page-1/#comment-89971</link>
		<dc:creator>bla</dc:creator>
		<pubDate>Tue, 10 Aug 2010 11:05:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/34-sizeof-comma-and-arithmetic-if-operators/#comment-89971</guid>
		<description>It&#039;s a bit confusing that a lower precedence corresponds to a higher precedence level here. Is that the standard way of saying it?</description>
		<content:encoded><![CDATA[<p>It&#8217;s a bit confusing that a lower precedence corresponds to a higher precedence level here. Is that the standard way of saying it?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Reshure</title>
		<link>http://www.learncpp.com/cpp-tutorial/34-sizeof-comma-and-arithmetic-if-operators/comment-page-1/#comment-69178</link>
		<dc:creator>Reshure</dc:creator>
		<pubDate>Sun, 27 Sep 2009 17:55:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/34-sizeof-comma-and-arithmetic-if-operators/#comment-69178</guid>
		<description>Are you using the comma operator too when initializing multiple variables in one statement?

&lt;pre&gt;
int x = 5, y = 3;
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Are you using the comma operator too when initializing multiple variables in one statement?</p>
<pre>
int x = 5, y = 3;
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: jeremy</title>
		<link>http://www.learncpp.com/cpp-tutorial/34-sizeof-comma-and-arithmetic-if-operators/comment-page-1/#comment-67735</link>
		<dc:creator>jeremy</dc:creator>
		<pubDate>Thu, 03 Sep 2009 23:11:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/34-sizeof-comma-and-arithmetic-if-operators/#comment-67735</guid>
		<description>Is it bad form to place the assignment inside the arithmetric if? eg.:

&lt;pre&gt;(x &gt; y) ? (z = x) : (z = y);&lt;/pre&gt;

It compiles fine with Codeblocks and GCC.
This seems more elegant IMHO.</description>
		<content:encoded><![CDATA[<p>Is it bad form to place the assignment inside the arithmetric if? eg.:</p>
<pre>(x &gt; y) ? (z = x) : (z = y);</pre>
<p>It compiles fine with Codeblocks and GCC.<br />
This seems more elegant IMHO.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mwgamera</title>
		<link>http://www.learncpp.com/cpp-tutorial/34-sizeof-comma-and-arithmetic-if-operators/comment-page-1/#comment-61987</link>
		<dc:creator>mwgamera</dc:creator>
		<pubDate>Fri, 05 Jun 2009 22:08:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/34-sizeof-comma-and-arithmetic-if-operators/#comment-61987</guid>
		<description>It&#039;s not a function, sizeof is an operator.
Its value is determined in compile time.</description>
		<content:encoded><![CDATA[<p>It&#8217;s not a function, sizeof is an operator.<br />
Its value is determined in compile time.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mwgamera</title>
		<link>http://www.learncpp.com/cpp-tutorial/34-sizeof-comma-and-arithmetic-if-operators/comment-page-1/#comment-61985</link>
		<dc:creator>mwgamera</dc:creator>
		<pubDate>Fri, 05 Jun 2009 22:00:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/34-sizeof-comma-and-arithmetic-if-operators/#comment-61985</guid>
		<description>Arithmetic if is a construct that takes a number and executes different things depending on
that number beeing less, equal or greater than zero. Such statement can be found in FORTRAN.
But there is no &lt;em&gt;arithmetic&lt;/em&gt; if in C++!
A ternary operator employs your usual &lt;em&gt;logical&lt;/em&gt; condition (i.e. if not zero).</description>
		<content:encoded><![CDATA[<p>Arithmetic if is a construct that takes a number and executes different things depending on<br />
that number beeing less, equal or greater than zero. Such statement can be found in FORTRAN.<br />
But there is no <em>arithmetic</em> if in C++!<br />
A ternary operator employs your usual <em>logical</em> condition (i.e. if not zero).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: manju23reddy</title>
		<link>http://www.learncpp.com/cpp-tutorial/34-sizeof-comma-and-arithmetic-if-operators/comment-page-1/#comment-60928</link>
		<dc:creator>manju23reddy</dc:creator>
		<pubDate>Sun, 17 May 2009 03:39:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/34-sizeof-comma-and-arithmetic-if-operators/#comment-60928</guid>
		<description>hi,
using sizeof function
will resolve during 
1. runtime
2. compile time 3. pre-compile time

plz answer me</description>
		<content:encoded><![CDATA[<p>hi,<br />
using sizeof function<br />
will resolve during<br />
1. runtime<br />
2. compile time 3. pre-compile time</p>
<p>plz answer me</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://www.learncpp.com/cpp-tutorial/34-sizeof-comma-and-arithmetic-if-operators/comment-page-1/#comment-35928</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Tue, 30 Dec 2008 05:10:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/34-sizeof-comma-and-arithmetic-if-operators/#comment-35928</guid>
		<description>The only place I see the comma operator commonly used is inside loops, to increment multiple variables, especially for loops.  We cover for loops in more detail in &lt;a href=&quot;http://www.learncpp.com/cpp-tutorial/57-for-statements/&quot; rel=&quot;nofollow&quot;&gt;Chapter 5.7 -- For statements&lt;/a&gt;.

Using the comma operator is a useful way to increment or decrement multiple variables in a single expression.  For example:

&lt;pre&gt;
nX++, nY++, nZ--;
&lt;/pre&gt;

Due to the particular syntax constraints on for loops, all your variables have to be modified in a single expression -- this allows you to do that.</description>
		<content:encoded><![CDATA[<p>The only place I see the comma operator commonly used is inside loops, to increment multiple variables, especially for loops.  We cover for loops in more detail in <a href="http://www.learncpp.com/cpp-tutorial/57-for-statements/" rel="nofollow">Chapter 5.7 &#8212; For statements</a>.</p>
<p>Using the comma operator is a useful way to increment or decrement multiple variables in a single expression.  For example:</p>
<pre>
nX++, nY++, nZ--;
</pre>
<p>Due to the particular syntax constraints on for loops, all your variables have to be modified in a single expression &#8212; this allows you to do that.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve</title>
		<link>http://www.learncpp.com/cpp-tutorial/34-sizeof-comma-and-arithmetic-if-operators/comment-page-1/#comment-35911</link>
		<dc:creator>Steve</dc:creator>
		<pubDate>Tue, 30 Dec 2008 02:18:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/34-sizeof-comma-and-arithmetic-if-operators/#comment-35911</guid>
		<description>Hey, whats the point of the comma operator if all it does is evaluate to the rightmost operand?</description>
		<content:encoded><![CDATA[<p>Hey, whats the point of the comma operator if all it does is evaluate to the rightmost operand?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marvin</title>
		<link>http://www.learncpp.com/cpp-tutorial/34-sizeof-comma-and-arithmetic-if-operators/comment-page-1/#comment-18617</link>
		<dc:creator>Marvin</dc:creator>
		<pubDate>Tue, 10 Jun 2008 03:35:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/34-sizeof-comma-and-arithmetic-if-operators/#comment-18617</guid>
		<description>In your first example, shouldn&#039;t the \t be t only?

It wouldn&#039;t output like that unless I changed it.

Using Geany as IDE and gcc as compiler.

[ You are correct.  I&#039;ve updated the example.  Thanks!  -Alex ]</description>
		<content:encoded><![CDATA[<p>In your first example, shouldn&#8217;t the \t be t only?</p>
<p>It wouldn&#8217;t output like that unless I changed it.</p>
<p>Using Geany as IDE and gcc as compiler.</p>
<p>[ You are correct.  I've updated the example.  Thanks!  -Alex ]</p>
]]></content:encoded>
	</item>
</channel>
</rss>

