From: Eli Zaretskii Newsgroups: comp.os.msdos.djgpp Subject: Re: big-endian and little endian binaries Date: Sun, 16 Jan 2000 10:38:03 +0200 Organization: NetVision Israel Lines: 11 Message-ID: References: <85reog$bqi$1 AT plato DOT harvard DOT edu> NNTP-Posting-Host: is.elta.co.il Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: news.netvision.net.il 948012081 24825 199.203.121.2 (16 Jan 2000 08:41:21 GMT) X-Complaints-To: abuse AT netvision DOT net DOT il NNTP-Posting-Date: 16 Jan 2000 08:41:21 GMT X-Sender: eliz AT is In-Reply-To: To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Errors-To: dj-admin AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Sun, 16 Jan 2000, Damian Yerrick wrote: > >Any ideas on how, in C++, I might be able to write big-endian numbers > >(2-byte ints in this case) to a binary file when I'm on a machine that uses > >little-endian format? [snip] > I know I may be reinventing the wheel, but I couldn't find anything of > the sort in info libc. Do htonl and htons ring a bell?