The tilde symbol is one way :
~
. It is the binary negation operator. The boolean negation operator is the exclamation mark :
!
. The docs :
cplusplus.com : operators[
^].
What you tried, the
|=
, is the or equals operation.
ETA: You can display an integer in hexadecimal format like this :
printf( "integer value is %08X\n", integerValue );
That format specifier, the
%08X
part, would display eight hex digits with leading zeros.