
Worked-out Problems 479
The execution history is:
main()
scanf("%d",&n)
fib(4)
fillTable(4)
Output(4,5)
printf(" Fib of %d is %d\n",4,5);
scanf("%d",&n)
fib(3)
Output(3,3)
printf(" Fib of %d is %d\n",3,3);
Notice that fillTable() is not called after fib(3).
In this case, there is no cycle in the call graph revealing that fib is not recursive. As a result, the
AR for fib can be allocated statically.
D.4.3 Function Storage and Activation Record
Problem 4.3.24 Consider the following C program and assume that the ARs follow the same
general layout as standard Cdecl layout. Assuming that an integer requires 4-bytes and a double
data type 8-bytes, derive a ...