I am trying to combine byte values into a long variable.
I have four bytes each in an unsigned char:
unsigned char a = BC;
unsigned char b = 1E;
unsigned char c = 04;
unsigned char d = 00;
I want to have it so I can put the value 00041EBC into a long variable. This would mean I would need to combine char d,c,b,a in that order to get 00041EBC which is a hex value. I am reading these bytes into the chars from an external file and need to rearrange them and put the result in a long to get the correct numerical value. Any ideas? thanks.