Left-Shift Operator

The left-shift operator (<<) shifts the bits of its left operand to the left by the number of bits specified in its right operand. Bits vacated to the right are replaced with 0s; bits shifted off the left are lost. In Fig. 20.11, line 11 assigns variable number1 the value 960 (00000000 00000000 00000011 11000000). The result of left-shifting variable number1 eight bits in the expression number1 << 8 (line 17) is 245760 (00000000 00000011 11000000 00000000).

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset