It is possible to use hex values with the if statement
e.g.
insertwhere f is 15 in hex and not the ascii value. i know i could simply have value equal 15 but for readability i would prefer the hex to be displayed.Code:if (value == f) { ... }
It is possible to use hex values with the if statement
e.g.
insertwhere f is 15 in hex and not the ascii value. i know i could simply have value equal 15 but for readability i would prefer the hex to be displayed.Code:if (value == f) { ... }
Yep. Use the 0x prefix.
Also a prefix of 0 (no x) is octal - base 8. So 017 is actually the value 15 (decimal). It is a fairly common mistake for beginners to expect that 017 is in decimal, not octal.Code:if (value = 0x15) /* 0x15 is 21 in decimal */