Outline for April 11, 2024

Reading: zyBooks text §6.1–6.8
Due: Homework #1, due April 18, 2024

  1. Functions in C
    1. Parameters: pass (or call) by value
    2. Arguments: instantiations of parameters matched in order
    3. Return values
    4. Scope: local variables [scope.c]
    5. Show the program stack and how it relates to functions

  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: [email protected]
ECS 36A, Programming & Problem Solving
Version of April 18, 2024 at 9:27PM

You can also obtain a PDF version of this.

Valid HTML 4.01 Transitional Built with BBEdit Built on a Macintosh