You could create a macro to grab any byte you want:
Code:
itsme@dreams:~/C$ cat grabbyte.c
#include <stdio.h>
#define GRABBYTE(n,b) (((n) & (0xFF << ((4 - (b)) * 8))) >> ((4 - (b)) * 8))
int main(void)
{
unsigned int num = 0xAABBCCDD;
printf("byte1 = %X\n", GRABBYTE(num, 1));
printf("byte2 = %X\n", GRABBYTE(num, 2));
printf("byte3 = %X\n", GRABBYTE(num, 3));
printf("byte4 = %X\n", GRABBYTE(num, 4));
return 0;
}
itsme@dreams:~/C$ ./grabbyte
byte1 = AA
byte2 = BB
byte3 = CC
byte4 = DD
EDIT: 5 bonus points if you can figure out exactly how that macro works