How to reverse bits...

Kevin D. Quitt kdq at demott.COM
Tue Aug 14 09:09:53 AEST 1990


In article <1990Aug13.185757.3236 at sti.fi> ttl at sti.fi (Timo Lehtinen) writes:
>This might be trivial, but here goes...
>What's the most optimal way to reverse the bits in an unsigned char,
>i.e. change from MSB to LSB ordering ?
>
    If by optimal, you mean fastest with the least code, try a char[256]
array with the bits already reversed.  You just look 'em up.  (It may be
gross, but the table+code is often smaller than the conversion code). 



More information about the Comp.lang.c mailing list