Lecture 10: October 16, 2019

Reading: C text, §8
Due: Extra Credit 1: due October 21, 2019; Homework #2, due October 24, 2019


  1. Greetings and felicitations!
    1. When you upload your file to Canvas, it may append a number. That’s fine.
  2. C arrays and strings
    1. String representation: array of chars terminated by NUL (ASCII ‘\0’)
    2. Strings as arguments to functions (strcpy.c)
    3. gets(buf), fgets(buf, size, fp) (bad.c, good.c)
  3. Example: ptrstew.c
  4. C characters
    1. Input getchar() and output putchar() (cat1.c)
    2. Types of characters; include file ctype.h (dasc.c)
    3. Characters as integers and vice versa
  5. Printing (printf.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 17 2019 at 10:39AM

You can also obtain a PDF version of this.

Valid HTML 4.01 Transitional Built with BBEdit Built on a Macintosh