I'm writing a function which performs a cyclic shift on the bits of an unsigned character with bitwise operators.
For example: my variable is 128, so the bits are 1000 0000, if I cycle 2 then I get 0000 0010.
It works, my output is fine and everything, but I get an error message: 'stack around the variable number is corrupt'.
I think it has something to do with the fact that I add an integer to an unsigned char, but how do I correct it? Atoi doesn't work.