Monday, July 21, 2008

Write a program to find whether a given m/c is big-endian or little-endian!

//Byte-ordering
bool IsLittleEndian()
{
int nValue = 1;

if ( 1 == *(char *)&nValue)
{
return true;
}
else
{
return false;
}
}

0 comments: