Skip to content

Instantly share code, notes, and snippets.

@surinoel
Created July 16, 2019 08:30
Show Gist options
  • Save surinoel/e6b7cfff34924c75aff47f96447a43e5 to your computer and use it in GitHub Desktop.
Save surinoel/e6b7cfff34924c75aff47f96447a43e5 to your computer and use it in GitHub Desktop.
#include <stdio.h>
int main(void) {
int a = 0x01020304;
char *p;
p = (char *)&a;
for(int i=0; i<4; i++) {
printf("0x%02x\n", *(p + i));
}
return 0;
}
#if 0
0x04
0x03
0x02
0x01
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment