Path: utzoo!attcan!uunet!mailrus!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!rpi!crdgw1!underdog!volpe From: volpe@underdog.crd.ge.com (Christopher R Volpe) Newsgroups: comp.lang.c Subject: Re: How to reverse bits... Message-ID: <11047@crdgw1.crd.ge.com> Date: 15 Aug 90 12:41:02 GMT References: <2059@ux.acs.umn.edu> <1990Aug14.203212.16248@motcad.portal.com> <43975@apple.Apple.COM> Sender: news@crdgw1.crd.ge.com Reply-To: volpe@underdog.crd.ge.com (Christopher R Volpe) Lines: 16 In article <43975@apple.Apple.COM>, austing@Apple.COM (Glenn L. Austin) writes: |>jtc@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"? Works only on twos-complement machines. How about " c = ~c "?? It seems that there is a special purpose operator that does exactly and only what the question is asking, it ought to be used, no? Otherwise, what's it (the ~ operator) there for? ================== Chris Volpe G.E. Corporate R&D volpecr@crd.ge.com