I need to take all the digits in a hex number and “invert” them: all zeroes become non-zeroes (F) and all non-zeroes become zeroes.
I tried:
void someFunction(DWORD hexVal)
{
//...
hexVal = ~hexVal;
//...
}
and this changed 0xE0000000 to 0x1FFFFFFF instead of 0x0FFFFFFF.
How can I produce the desired result?
This should give you the desired result for 2 bytes. You get the idea for 4 bytes.