Re: Storing hex in QBytearray, extracting it and converting it to decimal
Code:
int dd = 0xA5;
p.push_back (0xA5);
qDebug () << "SOP: " << (int)p[0];
This results in -91 whereas 0xA5 stands for 165 in decimal.
How to store hex in QBytearray, extract it and convert it to decimal?
Added after 11 minutes:
This helped: http://www.qtcentre.org/threads/2959...019#post139019
Also, I could have casted it to unsigned char.
Re: Storing hex in QBytearray, extracting it and converting it to decimal
Yep. 256 - 91 = 165 last time I checked.