Previous Lecture | lect10 Before Slides | lect10 Annotated Slides | Next Lecture |
Topics
Code from lecture
https://github.com/ucsb-cs16-s18-mirza/cs16-s18-lectures/tree/master/lec-10
Pointers and structs
- Defining your own data types using structs
- Different ways of accessing member variables of a structs
- Pointers to structs, why and when to use them?
- Passing structs to functions by value, by reference and by address
C++ References
- Creating aliases with references
- Differences between references and pointers
- Constant pointers and references, when and why to use them
Mechanics of function calls with specific attention to call by reference
- Program layout: text, data, bss, stack and heap
- References as function formal arguments
- More on the run-time stack