new*_*777 2 c equality bitwise-and
在C语言中,我经常if以这种形式看到语句:
#define STATUS 0x000A
UINT16 InterruptStatus;
if (InterruptStatus & STATUS)
{
<do something here....>
}
Run Code Online (Sandbox Code Playgroud)
如果我有这样的陈述,处理时间或任何其他原因会不同于为什么这不是首选/替代方式?
#define STATUS 0x000A
UINT16 InterruptStatus;
if (InterruptStatus == STATUS)
{
<do something here....>
}
Run Code Online (Sandbox Code Playgroud)