Created
January 17, 2015 12:54
-
-
Save PkmX/a0073d4d7904137d9638 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 <stdint.h> | |
#include <inttypes.h> | |
#include <stdio.h> | |
int x = 0; | |
int main(void) | |
{ | |
int y = 0; | |
// ok: 0x60098c 0x7ffffb53904c | |
printf("%p %p\n", (void*) &x, (void*) &y); | |
// ok: 60098c 7ffffb53904c | |
printf("%" PRIxPTR " %" PRIxPTR "\n", (intptr_t) &x, (intptr_t) &y); | |
// ill: 6293900 -78409652 | |
printf("%d %d\n", (int) &x, (int) &y); | |
// ill: 0x60098c 0xfffffffffb53904c | |
printf("%p %p\n", (void*) ((int) &x), (void*) ((int) &y)); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment