Lecture 8: October 11, 2019
Reading: C text, §3.4–3.5, 6.1–7.5, 12.4
Due: Homework #1, due October 11, 2019
(Note extension);
Extra Credit 1: due October 21, 2019
- Greetings and felicitations!
- Ge’s office hour on Monday is cancelled; instead, he will have one on Thursday from 8:00am–10:00am in Room 47 Kemper
- There is an extra credit assignment, which is optional, focusing on Linux
- Extra credit: instead of how I planned to do it, I will now multiply it by 5. So if you get 80% on the extra credit, that raises your final score by 4 points (80% × 4)
- Warning: do not put int i in your for loop — declare it at the top of the function
- Go through scp
- Pointers and indirection
- A pointer is an address
- Declarations
- Address (&), dereference (*) operators
- Indirect references
- More on functions in C
- Parameters: pass (or call) by reference (also called output parameters)
- Example: swap function — exchange values of two variables (swap.c)
- Scope: local variables (scope.c)