Article View: comp.os.msdos.programmer
Article #2835Re: Reversing Ints easily in TC++
From: teittinen
Date: Mon, 29 Oct 1990 10:19
Date: Mon, 29 Oct 1990 10:19
22 lines
1317 bytes
1317 bytes
In article <i6TmR3w163w@doppler>, jdries%doppler@faatcrl (J. Francis
Dries, III) writes:
> Almost all the non-Intel world (or so I'm
> told) writes ints MSByte first, whereas Borland's TC++ is
> reading/writing ints/longs (I need longs, since I'm working with 32bit
> ints from the Sun) LSByte first.
>
> My Question is, is there a way to reverse the order, quickly or cleanly?
>
> Any ideas?
If my memory serves me right (I don't have the manual with me right
now) there is a library routine named swab() which does the byte
swapping for you.
I think that it is very interesting to glimpse through the manuals once
in a while and find out some interesting and useful library functions...
--
E-Mail: teittinen@finuh.bitnet ! "Studying is the only way
teittinen@cc.helsinki.fi ! to do nothing without
Marko Teittinen, student of computer science ! anyone blaming you" -me
Technical Details
Message-ID:
<3716.272c0229@cc.helsinki.fi>Path:
arc1-ca.pugleaf.net!utzoo!attcan!uunet!decwrl!ucbvax!bloom-beacon!eru!hagbard!sunic!news.funet.fi!hydra!hylka!teittinenReferences:
<i6TmR3w163w@doppler>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!decwrl!ucbvax!bloom-beacon!eru!hagbard!sunic!news.funet.fi!hydra!hylka!teittinen From: teittinen@cc.helsinki.fi Newsgroups: comp.os.msdos.programmer Subject: Re: Reversing Ints easily in TC++ Message-ID: <3716.272c0229@cc.helsinki.fi> Date: 29 Oct 90 10:19:21 GMT References: <i6TmR3w163w@doppler> Organization: University of Helsinki Lines: 22