Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdint.h>
- int main(int argc, char *argv[])
- {
- int i;
- uint32_t x = 0xAABBCCDD;
- uint8_t *p = (uint8_t *)&x;
- printf("x: %08x\n", x);
- for(i = 0; i < sizeof(x); i++)
- printf("p[%d]: %02x\n", i, p[i]);
- printf("Machine is %cE\n", p[0] == x >> 24 ? 'B' : 'L');
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement