Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What means by << ?

Status
Not open for further replies.

zaq888

MIS
Jun 2, 2003
46
0
0
MY
start = (message[START] << 8) + message[START +1];

what is the &quot;<<&quot; symbol means?

I'm Keep Studying.... please show the way...
Not Good in English
 
got it.. better check my c help


I'm Keep Studying.... please show the way...
Not Good in English
 
<< means to shift the individual bits left by the number of places specified.

message[START] << 8 would shift the bits in the START'th element in the array message left by 8 places.

Assume for the moment that the array message contained 32 bit integers and that the START'th element contained the value 255 (i.e 0x000000FF in hex).

In binary this is 00000000 00000000 00000000 11111111

After shifting the bits left by 8 places using the << 8 operation the integer would contain

00000000 00000000 11111111 00000000 or 0x0000FF00 or 65280 in decimal.

Cheers - Gavin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top