The ~ (bitwise negation) operator yields the bitwise complement of the operand. In the binary representation of the result, every bit has the opposite value of the same bit in the binary representation of the operand. The operand must have an integral type. The result has the same type as the operand but is not an lvalue.
0000000000000101
1111111111111010
Note that the ~ character can be represented by the trigraph ??-.
1111111111111111
The bitwise negation operator
has been extended to handle complex types. With a complex type, the
operator computes the complex conjugate of the operand by reversing
the sign of the imaginary part.