int sampleVariable; // declared and initialized and used elsewhere
if (sampleVariable & 2)
someCodeIwantExecuted();
したがって、sampleVariable を手動で操作して、if ステートメントが true として評価され、someCodeIwantExecuted() が実行されるようにしたい場合は、次のようにしますか?
sampleVariable |= (1 << 1);
sampleVariable の値がわからないので、残りのビットはそのままにしておく必要があることに注意してください。if ステートメントが常に true になるようにビットを変更するだけです。