diff options
| author | pepper <peppersclothescult@gmail.com> | 2015-01-10 21:32:32 -0800 |
|---|---|---|
| committer | pepper <peppersclothescult@gmail.com> | 2015-01-10 21:32:32 -0800 |
| commit | d53fa8a169832563c62262078b8d2ffe5cab8473 (patch) | |
| tree | b911d06d357d009c976709780f10e92ce915228a /main/endian_test.c | |
first
Diffstat (limited to 'main/endian_test.c')
| -rw-r--r-- | main/endian_test.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/main/endian_test.c b/main/endian_test.c new file mode 100644 index 0000000..3e831dd --- /dev/null +++ b/main/endian_test.c @@ -0,0 +1,11 @@ +#include <stdio.h> +int main(){ + int n = 1; + +// little endian if true + if(*(char *)&n == 1){ + printf("little endian\n"); + }else{ + printf("big endian\n"); + } +} |
