How to check whether a system is big endian or little endian?
In C, C++
int n = 1; // little endian if true if(*(char *)&n == 1) {...}
See also: Perl version
2.1m questions
2.1m answers
60 comments
57.0k users