Answer the following questions true (T) or false (F)

1. Each activation frame contains all the function’s code, as well as the automatic variables and formal parameters.

2. The activation frames in nested function calls are handled in a last-in/ first-out order.

1. False
Explanation: There is only one copy of the function’s code. The activation record contains the local variables and parameters created at each invocation of the function.But you can think of the activation frame as containing the functions code. The text does say only one copy but the discussion is almost as if there is a copy on each activation frame as a useful fiction.
2. True
Explanation: Suppose function A calls function B, calls function C. The A’s activation record is placed on top of the A’s caller’s activation record. B’s activation record is placed on top of A’s and C’s is placed on top of A’s. When A returns, its activation record is removed from the stack, and when B returns, its activation record is removed, and so on. All this in last-in-first-out order.

Computer Science & Information Technology

You might also like to view...

What is a NIC teaming policy, and what does it do?

What will be an ideal response?

Computer Science & Information Technology

Answer the following statements true (T) or false (F)

1. The virtual property is not inherited. 2. A class that has a pure virtual member function is called a concrete base class. 3. No objects can be defined of abstract base class type since it is an incomplete definition. 4. It is OK to assign between objects of base type and objects of derived type. 5. A pointer to objects of a derived class can be assigned pointers to objects of the base class in the inheritance hierarchy.

Computer Science & Information Technology