Created
October 5, 2016 12:32
-
-
Save patricksuo/2299e7bd94fc43f5620e2d3dfc152629 to your computer and use it in GitHub Desktop.
c code snippet: is_little_endian
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| int is_little_endian() { | |
| int a = 1; | |
| return ((char *)(&a))[0]== 1; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment