delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/10/09/21:25:39

Sender: nate AT cartsys DOT com
Message-ID: <361EB530.DD492547@cartsys.com>
Date: Fri, 09 Oct 1998 18:15:28 -0700
From: Nate Eldredge <nate AT cartsys DOT com>
X-Mailer: Mozilla 4.05 [en] (X11; I; Linux 2.0.35 i486)
MIME-Version: 1.0
To: djgpp AT delorie DOT com
Subject: Re: newbie: endianess
References: <6vm3gs$59n$1 AT news3 DOT tufts DOT edu>
Reply-To: djgpp AT delorie DOT com

Sigurdur Smarason wrote:
> 
> I'm trying to find a way to set the endianess for file i/o but I
> don't seem to be able to find any documentation on it. Does anybody know
> where I should go to find more info on the matter ?

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.
-- 

Nate Eldredge
nate AT cartsys DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019