/* File: stack2.c Demonstrate that local variables are placed on a "stack" */ #include double func1 (void) ; double func2 (void) ; double func3 (void) ; double func1 (void) { double x, y ; printf("func1: Address of x = %u, of y = %u\n", &x, &y) ; x = func2() ; return x ; } double func2 (void) { double x, y ; printf("func2: Address of x = %u, of y = %u\n", &x, &y) ; x = func3() ; return x ; } double func3 (void) { double x, y ; printf("func3: Address of x = %u, of y = %u\n", &x, &y) ; x = 17 ; return x ; } main() { double x, y ; printf("Size of double = %d\n\n", sizeof(double) ) ; printf("main: Address of x = %u, of y = %u\n", &x, &y) ; x = func1() ; }