-
Notifications
You must be signed in to change notification settings - Fork 114
reversebits
Ken Sharp edited this page Dec 8, 2023
·
1 revision
Reverse the bits in a byte.
unsigned char ReverseBits(unsigned char b);
b
The byte to reverse.
unsigned char b with bits reversed.
unsigned char a = ReverseBits(0b11110000);
a => 0b00001111
unsigned char a = ReverseBits(0b11001100);
a => 0b00110011
unsigned char a = ReverseBits(0b10110111);
a => 0b11101101