C++ Syntax
What does << mean and <<= mean and why are they any different to <, <=
Thanks
Steve
<< is the bitwise left shift operator whereas < is the less than operator.
You use << to shift the bits of a variable to the left. (there is also the >> operator which right shifts the bits)
eg if you had the binary number 000010 (2) and did this:
000010 << 2 you would get 001000 (8), in effect multiplying the number by 2^2 (4)
===========================
No sense being pessimistic. It wouldn''''t work anyway.
You use << to shift the bits of a variable to the left. (there is also the >> operator which right shifts the bits)
eg if you had the binary number 000010 (2) and did this:
000010 << 2 you would get 001000 (8), in effect multiplying the number by 2^2 (4)
===========================
No sense being pessimistic. It wouldn''''t work anyway.
===========================There are 10 types of people in the world. Those that understand binary and those that don't.( My views in no way reflect the views of my employer. )
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement