Possible Duplicate:
Detecting endianness programmatically in a C++ program
Is there any library function available to find the endian-ness of my PC?
Why you need a library if you can find it like this? :)
int num = 1;
if (*(char *)&num == 1)
{
printf("Little-Endian\n");
}
else
{
printf("Big-Endian\n");
}