c get nth byte of integer

int x = (number >> (8*n)) & 0xff;

where n is 0 for the first byte, 1 for the second byte, etc.

Leave a Comment