Question: Question 5 : Data Types and Scopes (25 Marks) a) Describe the eager approaches to reclaiming garbage ( 8 points ) b) How is a

Question 5: Data Types and Scopes (25 Marks)

a) Describe the eager approaches to reclaiming garbage (8points)
b) How is a reference to non-local variable in a static-scoped program connected to its definition? (5 points)
c) Consider the following skeletal C program:

void fun1(void); /* prototype */

void fun2(void); /* prototype */

void fun3void); /* prototype */

void main() {

int u, v, w;

. . .

}

void fun1(void) {

int v, w, x;

. . .

}

void fun2(void) {

int w, x, y;

. . .

}

void fun3(void) {

int x, y, z;

. . .

}

what variables are visible during execution of the last function called in the calling sequence:

main calls fun3; fun3 calls fun2; fun2 calls fun1.

assuming that dynamic scoping is used? Include with each visible variable the name of the function in which it was defined. (12 points):

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!