C# - Check a bool for a value and then flip it

Posted by halivingston on Stack Overflow See other posts from Stack Overflow or by halivingston
Published on 2010-05-01T00:09:23Z Indexed on 2010/05/01 0:17 UTC
Read the original article Hit count: 131

Filed under:
for (int i = 0; i < X; i++)
   myitem = (checkedDB) ? dirtyItem : cleanItem;

I wanted to know if there's a way of flipping checkedDB in the same statement, i.e. the next iteration checkedDB is the opposite of it's value, so like XORing.

© Stack Overflow or respective owner

Related posts about xor