From 4440208018462731313
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,738ae3371beb3408
X-Google-Attributes: gidf78e5,public
From: Hyman Rosen <hymie@prolifics.com>
Subject: Re: portable method of determining endianness byte order.
Date: 1999/11/30
Message-ID: <t73dtnacpa.fsf@calumny.jyacc.com>#1/1
X-Deja-AN: 555038989
X-NNTP-Posting-Host: firewall.jyacc.com
Approved: stephen.clamage@sun.com (comp.std.c++)
References: <38329967.470B6CED@hqs.mid.gmeds.com> <38359FF5.AB0B77E9@zetec.com>
X-UID: 0000000001
X-Status: $$$T
X-Complaints-To: abuse@panix.com
X-Trace: news.panix.com 943997318 16764 209.49.126.226 (30 Nov 1999 21:28:38 GMT)
Organization: PANIX Public Access Internet and UNIX, NYC
NNTP-Posting-Date: 30 Nov 1999 21:28:38 GMT
Newsgroups: comp.std.c++
Originator: clamage@taumet


Thomas Matelich <tmatelich@zetec.com> writes:
> Pukalo Boyd 810-492-3661 wrote:
> > I have been trying to find a portable method of determining the
> > endianness byte order at compile time

>    c = (char*)&n;
>    byte_ordering = (!*c) ? BIG_ENDIAN : LITTLE_ENDIAN;

This does not happen at compile time, but at run time,
so you have not answered the question.


[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]




