サンプル
void
function(
int
input)
{
if
(input & 0x101){
doSomething();
}
}
ソリューション
結果がゼロと等しくない場合、条件は true に評価されます。 これを直接表示すると、より明確になります。
void
function
(
int
input)
{
int
result = input & 0x101
;
if
(result != 0){
do
Something
();
}
}