C++ Syntax: shift: << >>
The shift operators bitwise shift the value on their left by the number
of bits on their right:-
- << shifts left and adds zeros at the right end.
- >> shifts right and adds either 0s, if value is an unsigned type, or
extends the top bit (to preserve the sign) if its a signed type.
2 << 4
is 32 and
-8 >> 3
Other Uses for << >>
<< and >> are reused
Go Back to the
The C++ Crib Top Page
If you have any comments about this page please send them to