Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   C Programming (http://www.velocityreviews.com/forums/f42-c-programming.html)
-   -   Question regarding sequence point in case of conditional operator (http://www.velocityreviews.com/forums/t561020-question-regarding-sequence-point-in-case-of-conditional-operator.html)

somenath 12-14-2007 10:01 AM

Question regarding sequence point in case of conditional operator
 


Hi All,

I have one question regarding the conditional operator.
In the draft C99 standard it is mentioned that

"1 The following are the sequence points described in 5.1.2.3:
-- The call to a function, after the arguments have been evaluated
(6.5.2.2).
-- The end of the first operand of the following operators: logical AND
&& (6.5.13);
logical OR || (6.5.14); conditional ? (6.5.15); comma , (6.5.17)."

My question is conditional operator consist of "?" and ":" . Now
if I try to modify the value of one particular variable between "?"
and ": " will it show undefined behavior?
For example

b = (a++)? a++: a++;
Here is the second increment of a++ will be undefined?

Regards,
Somenath




All times are GMT. The time now is 05:11 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.