Advertisement

C++ Syntax

Started by April 15, 2001 09:16 AM
1 comment, last by steveharper101 23 years, 7 months ago
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.
===========================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. )
Advertisement
THANKS ALOT FOR THE HELP GAV, IT CLEARED THINGS UP

This topic is closed to new replies.

Advertisement