Michael Turley wrote:
>> I'm probably chancing my arm here but I've been trying
> to finish a bit swapping program. The program is
> supposed to reverse the bit order in every byte of a
> binary file (I want it actually to reverse the bits in
> a 2 byte type but that can wait for the moment).
At the moment I'm just awake and have not had any coffee - the code frag
below may give a indication - it uses the bitwise shift operators >> <<.
c = (c << 1) | (c >> 7); /* rotate one bit left */
Regards...jmcc
--
********************************************
John McCormac * Hack Watch News
jmcc at hackwatch.com * 22 Viewmount,
Voice: +353-51-873640 * Waterford,
BBS&Fax: +353-51-850143 * Ireland
http://www.hackwatch.com/~kooltek
********************************************
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: 2.6
mQCNAzAYPNsAAAEEAPGTHaNyitUTNAwF8BU6mF5PcbLQXdeuHf3xT6UOL+/Od+z+
ZOCAx8Ka9LJBjuQYw8hlqvTV5kceLlrP2HPqmk7YPOw1fQWlpTJof+ZMCxEVd1Qz
TRet2vS/kiRQRYvKOaxoJhqIzUr1g3ovBnIdpKeo4KKULz9XKuxCgZsuLKkVAAUX
tCJKb2huIE1jQ29ybWFjIDxqbWNjQGhhY2t3YXRjaC5jb20+tBJqbWNjQGhhY2t3
YXRjaC5jb20=
=sTfy
-----END PGP PUBLIC KEY BLOCK-----
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!