This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Bit Operator

Hi ,

A "bit" of a fundamental query.

Suppose I declare two bit variables
bit MyBit1,MyBit2;

I need to do something if both bits are 1.

Are these two methods equivalent:

if(MyBit1 & MyBit2) // Logical &
{ do something....
}

if(MyBit1 && MyBit2) // Conditional &&
{ do something....
}

Thomas

0