Created
October 20, 2016 14:47
-
-
Save meritozh/38a269df2ae5485d474bbd91011b93e3 to your computer and use it in GitHub Desktop.
little endian and big endian
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 <netinet/in.h> | |
#include <stdio.h> | |
int main(int argc, const char *argv[]) { | |
int i = 1093173256; | |
int k = htonl(i); | |
printf("%d %d\n", i, k); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In a intel CPU platform, it will print
1093173256 142616641
.oct -> hex:
41 28 80 08 08 80 28 41
It means: