Question: 2. (10 pts) Consider the following program fragment void test int ii int[5] a; void f (int x) a[i] = 5; i=i-1; 1=x; a i3;

 2. (10 pts) Consider the following program fragment void test int

2. (10 pts) Consider the following program fragment void test int ii int[5] a; void f (int x) a[i] = 5; i=i-1; 1=x; a i3; What are the values of i and a [2] after function f returns if the parameter is passed by i a [2] value copy-in-copy-out_ reference need 3. (10 pts) Construct a small piece of code in C-style syntax like in the previous question that behaves differently for call-by-name and call-by-need

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!