Question: Draw the Activation Record stack during the execution of function sub1. Note that the main function calls sub2, and, then, sub2 calls sub1. Assume the

Draw the Activation Record stack during the execution of function sub1. Note that the main function calls sub2, and, then, sub2 calls sub1. Assume the pass-by-value parameter passing method and the dynamic scoping are used for the implementation. You can draw your stack using MSExcel, MSWord, or a similar tool, and, then you can upload your file to the system.

int sub1 (int a, float b) {

int x, y[2];

...

}

int sub2 (float p) {

float a=3.0*p;

return (sub1(5, a));

}

int main (void) {

float r=4.0;

printf ("%d ", sub2(r));

return (0);

}

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!