Try with the following program which I found in some other question.
unsigned short num;
unsigned char * array;
num = 0xFF00;
array = (char *) num;
if(array[0] = 0x00)
{
printf("littileEndian");
}
else
{
printf("bigEndian");
}
Read more at: http://tech.queryhome.com/12757/how-can-i-use-c-to-check-the-endianess-on-my-machine