Created
September 23, 2016 09:06
-
-
Save yodalee/0739f88d5e8ed06f1469eea7ad889922 to your computer and use it in GitHub Desktop.
This file contains 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
#include <stdio.h> | |
int main(int argc, const char *argv[]) | |
{ | |
int n = 1; | |
// little endian if true | |
if(*(char *)&n == 1) | |
printf("Litt\n"); | |
else | |
printf("Big\n"); | |
signed int lval = 0xFEDCBA98 << 32; | |
signed int aval = 0xFEDCBA98 >> 36; | |
unsigned int uval = 0xFEDCBA98u >> 40; | |
printf("lval %x aval %x uval %x\n", lval, aval, uval); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment