I now know how to check if there is a certain flag in a DWORD (Specifically a Windows style) by using the bitwise &
AND operator. How would I do this:
if (dwMyFlags & dwSomeFlag) {
// dwMyFlags contains dwSomeFlag
// ->> How do I remove dwSomeFlag from dwMyFlags?
}
I know subtracting it wouldn't work, is there some operator that can remove flags from a DWORD?
If you know the flag is set you can use exclusive or to unset:
If you are unsure of the state of the flag, you need to use bitwise &, and bitwise not ~