Is it possible to do a circular bit shift in c++?
i.e:
10001000 => 00010001 => 00100010 => 01000100
~Inquirer
Printable View
Is it possible to do a circular bit shift in c++?
i.e:
10001000 => 00010001 => 00100010 => 01000100
~Inquirer
I believe there is a "rotate" asm instruction that does this too...Code:char RotateLeft(char Byte)
{
return (char)((Byte << 1) | (Byte >> 7));
}
Not sure if a C/C++ function does it though.
not by any standard means, you could write a class to handle binary numbers and do it yourself. Or write a function that does a circular bit shift.
-LC