int data = 0x0; if(data & 0x2 == 0) { printf("1\n"); } else { printf("2\n"); }
这段代码太简单了,简单到不需要特别在意。
但是一不小心就踩坑了。
== 的优先级比 & 大,所以运行出来的是“2”。
==
&