【发布时间】:2015-06-11 21:28:14
【问题描述】:
我需要对uint 类型的值执行按位“&”操作。
enum MsgType : ulong
{
Begin = 0x00000001,
}
unit number= 0x00000002;
if (number & MsgType.Begin == MsgType.Begin)
//不工作
报错:
Operator '&' cannot be applied on operands of type 'uint' or 'bool'
如何投射?
【问题讨论】:
-
这是哪种语言或平台?
-
使用的语言是C#。
-
不清楚这里应该测试什么。也许(数字!= 0)。