Last active
October 23, 2018 14:50
-
-
Save mlouielu/3277952b821e0c77ddaaecc37e198db4 to your computer and use it in GitHub Desktop.
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> | |
#include <stdlib.h> | |
int c = 0xffffeeee; | |
int main() { | |
int a = 0x12345678; | |
int b = 0xdeadbeaf; | |
int *d = malloc(sizeof(int)); | |
int *e = malloc(sizeof(int)); | |
printf("%p %p %p %p %p\n", &a, &b, &c, d, e); | |
} | |
/* | |
* On 4.13.0-17-generic #20-Ubuntu SMP x86_64 | |
* $ gcc -O0 stack_heap.c | |
* $ ./a.out | |
* 0x7ffe0d98ebc0 0x7ffe0d98ebc4 0x5655196bb010 0x56551b553260 0x56551b553280 | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment