I'm making a flags class in C++ for some practice. I have a function that should reset a flag. I figured it would work by NORing the bit value with the flags variable. I just cant work out how to stick not NOT in there. Heres my non-working code. It should explain better what I'm trying to do here:
Code:
bool Flag32::ResetBit(Uint8 bit)
{
if(bit < 1 || bit > 32) return false;
flags !|= (1 << (bit-1));
return true;
}
Someone know how I can do this? I know I could do this by checking if the bit is on or off, then subtracting or not, I'd just like to be able to Nor stuff