New course! Every coder should learn Generative AI!
Try a free lesson+ 2
Yes, I really like them for instance for:
//collect inputs
If (cond1) flag|=1; // binary 001
If (cond2) flag|=2; // binary 010
If (cond3) flag|=4; // binary 100
…
// Check for any condition true
If (flag)…
This is simple and easy. Of course, it is only useful this way, if the mentioned checks are on different code locations.