2009年1月5日 星期一

How to check CPU endian on Embedded Linux


Sometimes you don't know what type of CPU endian on your ARM platform. Here you can write a very simple program to test

/* Test CPU Endian */
#include
#include

int main() {
if (htons(1) == 1) puts("big endian");
else puts("little endian");
return 0;
}
/* End */

沒有留言: