Определение byteorder
int main(int argc, char *argv[])
{
int test = 1;
if ( (((char *)(&test))[0]) == 1)
{
printf("NDR (little_endian)\n");
return 0; //NDR (little_endian)
}
else
{
printf("XDR (big_endian)\n");
return 1; //XDR (big_endian)
}
}
Comments
NDR indicates Network Data Representation (little-endian)
XDR represents External Data Representation (big-endian)