Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

No, compilers don’t take endianness into account. (especially not C)

You need to use a bit mask in order to make this code endian-independent rather than a pointer alias. Like (uint8_t)(int & 0xFF), or something like that.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: