From: Sigurdur Smarason Newsgroups: comp.os.msdos.djgpp Subject: Re: newbie: endianess Date: 10 Oct 1998 03:01:01 GMT Organization: Tufts University Lines: 15 Message-ID: <6vmild$tbu$1@news3.tufts.edu> References: <6vm3gs$59n$1 AT news3 DOT tufts DOT edu> <361EB530 DOT DD492547 AT cartsys DOT com> NNTP-Posting-Host: emerald.tufts.edu X-Trace: news3.tufts.edu 907988461 30078 (None) 130.64.1.16 X-Complaints-To: news AT news DOT tufts DOT edu X-Newsreader: TIN [UNIX 1.3 unoff BETA 970705; alpha OSF1 V4.0] To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Nate Eldredge wrote: : You can't change the endianness, a file is just a bunch of bytes. If : you have multi-byte values (i.e. words) that you want to store, you must : figure that out yourself. The `htonl' and `ntohl' functions may be : helpful if what you want doesn't happen to match the CPU's spec. : -- so if I want to read a file that I know is stored in one endian format, but the program is running on a CPU that is possibly the opposite the only way I can get the actual values is by swaping the bytes after I read them ? Siggi