Jun 15, 2003 #1 zaq888 MIS Joined Jun 2, 2003 Messages 46 Location MY start = (message[START] << 8) + message[START +1]; what is the "<<" symbol means? I'm Keep Studying.... please show the way... Not Good in English
start = (message[START] << 8) + message[START +1]; what is the "<<" symbol means? I'm Keep Studying.... please show the way... Not Good in English
Jun 15, 2003 Thread starter #2 zaq888 MIS Joined Jun 2, 2003 Messages 46 Location MY got it.. better check my c help I'm Keep Studying.... please show the way... Not Good in English Upvote 0 Downvote
Jun 16, 2003 #3 Robinhood361 Programmer Joined Apr 9, 2003 Messages 18 Location IN thats the left shift operator... look in binary operations Upvote 0 Downvote
Jun 16, 2003 #4 newmangj Technical User Joined Jun 16, 2002 Messages 150 Location AU << 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 Upvote 0 Downvote
<< 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