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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to convert byte array to unsigned short

Status
Not open for further replies.

Rodie

Programmer
Jun 27, 2004
132
FR
Hello ! I tried to find how to convert an array of 2 bytes into an unsigned short (no sign bit), but the solutions I found on the Web don't work

For example, I want that :
input = [1111 1111 0000 0000] (= [255 0] = [LSB MSB])
output = 255 (and not -1 because there is no sign bit)

Thanks for your help !
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top