Lecture 15: May 5, 2023

Reading: zyBooks, §9.4
Assignments: Homework 2 and Extra Credit 2, due May 10

  1. Announcements
    1. Tutoring available from the CS Tutoring Club; sign up information in an announcement

  2. Reading, writing text data with a fixed format
    1. Reading in text data with a fixed format (fscanf, scanf)
    2. Outputting text data with a fixed format (fprintf, printf) [printf.c]

  3. Printing the contents of a file
    1. Simple copy [scopy.c]
    2. Using fputs [printfile1.c]
    3. Using putchar [printfile2.c]
    4. Using command-line arguments [printfile3.c]

  4. Other useful stuff
    1. Test for end of file (feof, also EOF or NULL)

  5. Binary file I/O
    1. Reading with fread
    2. Writing with fwrite
    3. Binary simple copy [sbcopy.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 May 7, 2023 at 8:25PM

You can also obtain a PDF version of this.

Valid HTML 4.01 Transitional Built with BBEdit Built on a Macintosh