How to reverse bits...

Glenn L. Austin austing at Apple.COM
Wed Aug 15 15:10:02 AEST 1990


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"?

-- 
-----------------------------------------------------------------------------
| Glenn L. Austin               | "Turn too soon, run out of room,          | 
| Auto Racing Enthusiast and    |   Turn too late, much better fate"        |
| Communications Toolbox Hacker |   - Jim Russell Racing School Instructors |
| Apple Computer, Inc.          | "Drive slower, race faster" - D. Waltrip  | 
| Internet:   austing at apple.com |-------------------------------------------|
| AppleLink:  AUSTIN.GLENN      | All opinions stated above are mine --     |
| Bellnet:    (408) 974-0876    |                who else would want them?  |
-----------------------------------------------------------------------------



More information about the Comp.lang.c mailing list