I know this code is completely valid but in the interest of learning, how would I achieve the same thing as below using bitwise operations on the unsigned4 value instead of the union "trick"?
Code:void value(unsigned4 v) { union { struct { signed2 left; signed2 right; } split; unsigned4 combined; } trick; //Set the base value trick.combined = v; //"Split" the value into left and right values left = trick.split.left; right = trick.split.right; }