// Example demonstrating memory addess assignments, separate compilation // George F. Riley, Georgia Tech, Fall 2009 int g1; // Global variable 1 int g2; // Global variable 2 int g3; // Global variable 3 int sub3() { // Third subroutine int s3l1; // Sub1, local variable 1 int s3l2; // Sub1, local variable 2 int s3l3; // Sub1, local variable 3 char* s3hello = "Hello"; printf("Sub3, Address of g1 is %p\n", &g1); printf("Sub3, Address of g2 is %p\n", &g2); printf("Sub3, Address of g3 is %p\n", &g3); printf("Address of s3l1 is %p\n", &s3l1); printf("Address of s3l2 is %p\n", &s3l2); printf("Address of s3l3 is %p\n", &s3l3); printf("s3hello is %p\n", s3hello); }