I have additional qestion

Qt Code:
  1. test[0]= 0xAB;
  2. test[1]= 0xCD;
  3. test[2]= 0xEF;
  4. test[3]= 0x01;
  5. test[4]= 0x02;
  6. test[5]= 0x03;
  7. 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

Qt Code:
  1. usnigned long num;
  2. num |= (unsigned char)(test[1]) << 8;
  3. num |= (unsigned char)(test[2]) << 8;
  4. num |= (unsigned char)(test[4]) << 8;
  5. 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