Topics
Code from lecture
C++ Memory model
- Barebones model of memory: value vs address
- Scope: local vs. global
- Layout of compiled C++ program in memory: text, global data , heap and stack
C++ arrays
- Intro to lab04
- C/C++ arrays are like lists in Python and Arrays in Java. We will discuss the differences between these.
- Declaring and initializing arrays in C++
- Tracing code involving arrays
- Array pitfalls: out of bound array access
Under the hood of function calls
- Function calls use the run-time stack, we’ll see how and why that’s important
- Review of pass by value
- Passing parameters to functions by value