I've been tasked with commenting some old code on our project, and am having trouble finding out what the following "if" condition is doing. I've figured out that the hex number there equates to decimal -32768, and I have a pretty good general idea of how the '&' operator works, but it's just not coming together for me. Any ideas?
Imagine "FFFF8000" as a binary number: it's seventeen ones followed by fifteen zeros. The expression "if((0xFFFF8000 & status) != 0)" means "if one or more of the first seventeen bits of 'status' are set to one..." This kind of code is generally used to pack a whole bunch of boolean flags into one int, to save space.