Skip to content

Instantly share code, notes, and snippets.

@zhoukuo
Created July 10, 2012 09:32
Show Gist options
  • Save zhoukuo/3082298 to your computer and use it in GitHub Desktop.
Save zhoukuo/3082298 to your computer and use it in GitHub Desktop.
Big-endian or little-endian
/* (char)i ? printf("l\n") : printf("b\n"); */
#include <stdio.h>
int byteorder(void)
{
int i = 0x0001;
(char)i ? printf("l\n") : printf("b\n");
return i;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment