On Thu, Jul 16, 2009 at 4:54 PM, Michael White<[email protected]> wrote:
> A way to help determine how you want the following scenario to play out
> is to surround the piece of code you want to be sure is enacted on first with 
> ( ).
>
> For example...
>
> int b = a / (++a);
>
> This will remove all doubt as to what will happen.

No it won't. Adding parenthesis does absolutely nothing in this situation.

It's still invalid code, because either the numerator or denominator
can be examined first, leading to two different possible answers.

-- 
PJH

http://shabbleland.myminicity.com/com
http://www.chavgangs.com/register.php?referer=9375

Reply via email to