Swapping 2 Bytes of Integer

Couple of things You can recombine by masking x with a value that is all FF except for bytes m and n You can compute the mask by left shifting 0xFF m times and n times and combining the result and then XOR it with 0xFFFFFFFF FYI when you right shift a signed value, it … Read more