Wednesday, July 26, 2006

Little / Big Endian

/***
A program to find if a machine is big or little endian.
***/
#include
main()
{
int i = 1;
char *p= (char *)&i;

if(*p == 1)
printf("Little");
else
printf("Big");
printf(" Endian\n");
}

1 comment:

Anonymous said...

Cool man!