Previous Lecture | Lecture 5 | Next Lecture |
Lecture 5, Thu 10/11
Functions, C++ Memory Model
Code from lecture
Review: Designing nested loops
- When do we need a loop?
- When do we need a nested loop?
- Checking for limits
- Practice with ASCII art (also topic of lab02)
Three key aspects of functions
- Declaration (what are the inputs, outputs?)
- Definition (actual code for achieving the desired behavior)
- Function call (using function)
C++ Memory Model
- Program layout in memory: text, global data , heap and stack
- The stack and its purpose
- Global vs. local variables