I have the following QByteArray
snap.png
For Message[3] I want to get the decimal value 201 and not -51. How do I do that? And where did this -51 come from?
I have the following QByteArray
snap.png
For Message[3] I want to get the decimal value 201 and not -51. How do I do that? And where did this -51 come from?
The byte can be interpreted as either an 8 bit unsigned/positive number or a 7bit signed number.
-55 is the two complement of 201 (255 - 201 + 1)
If you assign the value to a uchar then its value will be 201 since this removes the ambiguity.
Cheers,
_
Miss Engineer (28th May 2014)
Bookmarks