How to reverse bits...
Frank P. Bresz
fpb at ittc.wec.com
Thu Aug 16 10:10:12 AEST 1990
In article <464.26c93018 at astro.pc.ab.com> browns at astro.pc.ab.com (Stan Brown, Oak Road Systems) writes:
>Please, no magic numbers. You can use the bitwise-complement operator, ~ tilde
>(pronounced, "squiggle").
> c = ~c
>It works on any numeric type, and the result has the same type as the operand.
>Typical application: to sset all the bits in n unsigned word:
Great solution obviously but it is not (pronounced, "squiggle").
its pronounced tilda.
--
+--------------------+
|fbresz at ittc.wec.com | My opinions are my own, I'm not paid
|uunet!ittc!fbresz | enough to make an official statement
|(412)733-6749 | +-----------------------------------+
|Fax: (412)733-6444 | | THIS SPACE FOR SALE!!! |
+--------------------+ +-----------------------------------+
More information about the Comp.lang.c
mailing list