/*
 * File: endian.c
 *
 * Copyright (c) 2009 Bruce Blinn
 *
 * Description
 *	Identify which byte order is used by the processor on the current
 *	system.
 *
 * Use the following command to compile this program:
 *
 *	$ cc -o endian endian.c
 */

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[])
{
	union {
		int i;
		char c[sizeof(int)];
	} foo;

	foo.i = 1;
	if(foo.c[0] == 1)
		printf("Little endian\n");
	else
		printf("Big endian\n");

	exit(0);
}
