Mask-group

Operations on Bits



  • One of C’s powerful features is a set of bit manipulation operators. These permit the programmer to access and manipulate individual bits within a piece of data.

  • The various Bitwise Operators available are-

Operator

Meaning

~

One's complement

>>

Right shift

<<

Left shift

&

Bitwise AND

|

Bitwise OR

^

Bitwise XOR(Exclusive OR)

  • These operators can operate upon ints and chars but not on floats and doubles.