Magic money not working bigendian

Mike McNally m5 at vail.tivoli.com
Fri Feb 11 05:50:31 PST 1994



Robert M. Solovay writes:
 > Is there a simple way to find out if ones computer is big-endian or
 > not? [Like a simple C program that one can compile and run to settle
 > the question.]

Perhaps I can redeem myself by doing the cypherpunk thing and writing
code:

int isBigEndian()
{
	int test = 0;
	char *testP = (char *) &test;

	*testP = 0xff;

	return !(test & 0xff);
}

--
| GOOD TIME FOR MOVIE - GOING ||| Mike McNally <m5 at tivoli.com>       |
| TAKE TWA TO CAIRO.          ||| Tivoli Systems, Austin, TX:        |
|     (actual fortune cookie) ||| "Like A Little Bit of Semi-Heaven" |






More information about the cypherpunks-legacy mailing list