View the step-by-step solution to:

if I let func be the following function, written in an imaginary language:

I need help... if I let func be the following function, written in an imaginary language:

void func(int j, int k)

{

j--;

i++;

k = i + 2;

}

Assume that i is global to this function and that a is an array of integers. Now, suppose that the following statements are executed:

i = 2;

a[2] = 2;

func(i, a[i]);


For each of the following sets of assumptions, indicate what the values of i and a[2] will be after the call of func.



(a) j and k are passed by reference.

(b) j and k are passed by value-result.

(c) j is passed by reference and k is passed by value-result.

(d) j is passed by value and k is passed by reference.

(e) j and k are passed by name.

Top Answer

Values of i and a[2] after the call of function: (a) i... View the full answer

Sign up to view the full answer

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

-

Educational Resources
  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question
Ask a homework question - tutors are online