Daily One Algorithm
A blog dedicated to those who live, drink and eat Algorithms.
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
Friday, September 04, 2009
Cool man!
Reply
Delete
Replies
Reply
Add comment
Load more...
‹
›
Home
View web version
Cool man!
ReplyDelete