I have additional qestion 
test[0]= 0xAB;
test[1]= 0xCD;
test[2]= 0xEF;
test[3]= 0x01;
test[4]= 0x02;
test[5]= 0x03;
test[6]= 0x04;
QByteArray test;
test[0]= 0xAB;
test[1]= 0xCD;
test[2]= 0xEF;
test[3]= 0x01;
test[4]= 0x02;
test[5]= 0x03;
test[6]= 0x04;
To copy to clipboard, switch view to plain text mode
I need to take only the following bytes
test[1]= 0xCD;
test[2]= 0xEF;
test[4]= 0x02;
test[5]= 0x03;
and show it as a single number
0xCDEF0203 = 3454992899
I try to use the code but it does not work
usnigned long num;
num |= (unsigned char)(test[1]) << 8;
num |= (unsigned char)(test[2]) << 8;
num |= (unsigned char)(test[4]) << 8;
num |= (unsigned char)(test[5]) << 8 ;
usnigned long num;
num |= (unsigned char)(test[1]) << 8;
num |= (unsigned char)(test[2]) << 8;
num |= (unsigned char)(test[4]) << 8;
num |= (unsigned char)(test[5]) << 8 ;
To copy to clipboard, switch view to plain text mode
Why it does not work ? Maybe is it easier method to do it ?
Regards
Artur
Bookmarks