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

Parents Reply Children
No data
More questions in this forum