How to reverse bits...
George V. Reilly
gvr at cs.brown.edu
Wed Aug 15 16:07:26 AEST 1990
In article <43975 at apple.Apple.COM> austing at Apple.COM (Glenn L. Austin) writes:
>jtc at motcad.portal.com (J.T. Conklin) writes:
>>Another useful table is one that flips the bits 1-for-0,0-for-1. This
>>is useful for inverting an image.
>
>How about "c ^= (char) -1"?
How about ~, the built-in one's complement operator? Just mask off the
high-order bits if you don't want them.
output = ~input & 0xFF
________________
George V. Reilly gvr at cs.brown.edu
uunet!brunix!gvr gvr at browncs.bitnet Box 1910, Brown U, Prov, RI 02912
More information about the Comp.lang.c
mailing list