Lecture 27 Outline (November 30, 2015)

Reading: text, §11

  1. Greetings and felicitations!
    1. Midterms are in my office; you can come get them there.
    2. Homework 5 is last homework
    3. I will schedule a review session on December 7 or 8, depending on when I can get a room

  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)

  3. Reading, writing characters and lines
    1. Reading text data as lines (fgets, gets — do not use this!)
    2. Reading text data as characters (fgetc, getc, getchar, ungetc)
    3. Writing text data as lines (fputs, puts— latter adds a trailing newline)
    4. Writing text data as characters (fputc, putc, putchar)

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

  5. Conditional operator
    1. condition ? if_true : if_false

  6. Macros
    1. Without arguments
    2. With arguments

You can also obtain a PDF version of this. Version of November 30, 2015 at 6:43AM