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


  1. Greetings and felicitations!
    1. Ge’s office hour on Monday is cancelled; instead, he will have one on Thursday from 8:00am–10:00am in Room 47 Kemper
    2. There is an extra credit assignment, which is optional, focusing on Linux
    3. 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)
    4. Warning: do not put int i in your for loop — declare it at the top of the function
    5. Go through scp
  2. Pointers and indirection
    1. A pointer is an address
    2. Declarations
    3. Address (&), dereference (*) operators
    4. Indirect references
  3. More on functions in C
    1. Parameters: pass (or call) by reference (also called output parameters)
    2. Example: swap function — exchange values of two variables (swap.c)
    3. Scope: local variables (scope.c)

UC Davis sigil
Matt Bishop
Office: 2209 Watershed Sciences
Phone: +1 (530) 752-8060
Email: mabishop@ucdavis.edu
ECS 36A, Programming and Problem Solving
Version of October 12, 2019 at 8:11PM

You can also obtain a PDF version of this.

Valid HTML 4.01 Transitional Built with BBEdit Built on a Macintosh