How can you access the individual bytes making up a variable of type long? What I need to do is move a 24-bit (3 bytes) unsigned char array into a long variable. An example:
unsigned char a[3]; unsigned long b; a[0] = 0x02; a[1] = 0xFF; a[2] = 0xFF; ????? ?????
"Casting the pointer seemed to do the trick just fine." but don't forget that it relies upon C51's internal data representation - so it would be a good idea to do something like Drew's idea to ensure that nobody forgets this and tries to re-use the code on a different target...