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> | |
main() { | |
int n[] = {1819043144, 663919}, i; | |
char *c; | |
c = (char*)n; | |
printf("%s", c); | |
} | |
/* Little Endian! Each byte goes forwards, but the 4 bytes go | |
* into the int backwards! | |
* | |
* H = oct 110 = b 01001000 | |
* e = oct 145 = b 01100101 | |
* l = oct 154 = b 01101100 | |
* l = oct 154 = b 01101100 | |
* 01101100 01101100 01100101 01001000 = 1819043144 | |
* | |
* o = oct 157 = b 01101111 | |
* ! = oct 041 = b 00100001 | |
* \n = oct 012 = b 00001010 | |
* \0 = oct 000 = b 00000000 | |
* 00000000 00001010 00100001 01101111 = 663919 | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment