Path: 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: Organization: University of Helsinki Lines: 22 In article , 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