EECS 280 Lecture Notes - Lecture 2: Call Stack, Lecture Recording, Unit Testing

80 views3 pages

Document Summary

Lecture 2 the call stack, procedural abstraction, and testing. Memory for functions: for good explanation watch lecture slide 4. Call stacks: when a function is called, data for the execution of that function is stored as an activation record (stack frame) (stored in a stack) E. g. local variables, parameters, return address, etc: stack is a container with the last-in-first-out property. Can"t access from the bottom or middle. Return some value (optional: passive flow, start the original function where it left off, destroy the stack from (in simple cases, do nothing) Exercise 2. 2: minof3 contains 5 variables, 3 different stack frames for min, 40 bytes; int takes 4 bytes, there are 10 vars used at one time. Pass by value: regular parameter passing is done by value i. e. (cid:449)e do(cid:374)"t pass o(cid:271)je(cid:272)ts, just their (cid:448)alues. Pass by reference: the parameter is just another name (an alias) for the original object, like passing the whole object.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents