Lecture 8: April 19, 2023

Reading: zyBooks, §5.10
Assignments: Homework 1 and Extra Credit 1, due April 24

  1. Announcements
    1. Ask if there are questions about the homework or running programs on the CSIF

  2. More on arrays
    1. Initializations
    2. Contrast with pointer initialization

  3. C arrays and strings
    1. String representation: array of chars terminated by NUL (ASCII ‘\0’)
    2. gets(buf), fgets(buf, size, fp) [bad.c, good.c]
    3. Array of strings (pointers to characters)

  4. Example: ptrstew.c

UC Davis sigil
Matt Bishop
Office: 2209 Watershed Sciences
Phone: +1 (530) 752-8060
Email: mabishop@ucdavis.edu
ECS 36A, Programming & Problem Solving
Version of April 21, 2023 at 9:56AM

You can also obtain a PDF version of this.

Valid HTML 4.01 Transitional Built with BBEdit Built on a Macintosh