View Single Post
Old 03-01-2017, 09:03 AM   #87 (permalink)
t vago
MPGuino Supporter
 
t vago's Avatar
 
Join Date: Oct 2010
Location: Hungary
Posts: 1,807

iNXS - '10 Opel Zafira 111 Anniversary

Suzi - '02 Suzuki Swift GL
Thanks: 830
Thanked 708 Times in 456 Posts
And for clarity, when I say "conditional," I mean

Code:
If (some comparison performed between value 1 and value 2 happens to be true) then

    (do something)

else

    (do something else)

end if
In C++, it's quite possible to stuff value 1 and/or value 2, with an assignment statement that contains a computation, within the if-then construct itself, like so:

Code:
if ((unsigned int a = 3 * b + c) == 4) doSomething;
It's certainly valid for C++, but it's frowned upon because it's not all that readable and can lead to very subtle bugs due to programmers mistakenly using "=" when they meant to type "==".
  Reply With Quote