What is the difference between Bitwise AND & and LOGICAL AND &&
本问题已经有最佳答案,请猛点这里访问。
Possible Duplicate:
What is the difference between logical and conditional AND, OR in C#?
位与逻辑与逻辑与位之间的区别是什么??
修改积分与比特操作,IE.
Bitwise,as it s name implies,it's an and operation at the bitel level.
所以,如果你在两个积分上做一个比特:
1 2 3 | int a = 7; // b00000111 int b = 3; // b00000011 int c = a & b; // b00000011 (bitwise and) |
在另一只手上,在C 35;,逻辑与操作在逻辑(Boolean)水平。所以你需要Boolean Values as Operators,and result is another logical value:
ZZU1
但只有在逻辑层面。
好问题(重复思考)。
Bitwise and will infect its operators on the bit-level I.E.looping and doing logical and operation on every bit.
On the other hand,
逻辑上和将要两个操作员检查他们的正直性(作为一个整体)并决定上面(说明在C 355;是两个字节长)。