Let's do a walk through and start with some assumptions.

1) let us assume that sizeof(int) = 4 (32 bits).

2) CHAR_BIT appears to be number of bits in a char (8).

3) The object here looks like it will input ABCD and return DCBA.

Each loop will take one group of CHAR_BIT (8) bits out of right and place it into left.

It prepares for the next iteration by shifting the remaining bits in right down 8 bits and shifting the value in left up by 8 bits.

You will see right and left looking like:

right | left

ABCD | ----

-ABC | ---D

--AB | --DC

---A | -DCB

---- | DCBA

After i reaches sizeof(int), the value in left is returned.

right has no arguments as it is itself an argument.

Can you see the mistake in this function?

Bill