// from ostep/code/vm-intro/va.c, modified to also print address of a static variable // #include #include int z = 9; // static int main(int argc, char *argv[]) { printf("location of code : %p\n", main); printf("&z : %p\n", &z); printf("location of heap : %p\n", malloc(100e6)); int x = 3; printf("location of stack: %p\n", &x); return 0; } /* example output: location of code : 0x400542 &z : 0x601048 location of heap : 0x7f739c86c010 location of stack: 0x7ffd3302d9fc */