Concatenation of two hex values

Hello!

I am working on a program that essential returns a PID and then gives me 8 individual hex values. For example:

Lets say.... int message[8];

and in it are... message[1] = 04 message[2] = D7

my final value should be 04D7 (or the integer equivalent 1239). How would I go about getting those together to get the 1239 out of it?

unsigned result = (message[1] << 8) | message[2];

Holy geez. Thanks! If I told you how long i was trying to figure that out you would be surely disappointed!