CSC 4101 Chapter : Homework 4 Solutions

22 views3 pages
15 Mar 2019
School
Course
Professor

Document Summary

Homework 4 solutions: the stack contains the following activation records: main. For each activation record, the dynamic link points to the activation record directly above. The static links point to the activation record of the statically enclosing scope. I. e. , the static links of the activation records of a and b point to foo. The static link of c"s activation record points to a. The static link of d"s activation record points to the activation record of b immediate above. i a[1] a[2] value 7 3 5 copy-in-copy-out 7 3 7 reference 5 3 5 need 3 3 5. With call-by-value, call-by-reference, and copy-in-copy-out, the argument expression a[i] gets evaluated before the function is called. I. e. , modifying i inside f does not have an effect on a[i]. In the case of call-by-value and copy-in-copy-out, the value of a[2] is copied into x. For copy-in-copy-out, the value of x at the end of the function is then copied back into a[2].

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents