Outline for April 12, 2002

Handouts: More Sample C Programs
Reading: Johnsonbaugh & Kalin pp. 230-237, 305-329


  1. Greetings and felicitations!
    1. Homework 2 to be handed out on Monday, will be due on April 29
  2. copy1.c
    1. strings (NUL-terminated arrays)
    2. printing strings
  3. copy2.c
    1. definition of pointer; address of variables (&), dereferencing of pointer (*)
    2. how it is used
    3. pointer arithmetic (in the printf)
  4. swaps.c
    1. pointers and parameter lists
    2. pointers and var paramaters
  5. paa.c
    1. str1copy: condition on for, explicit comparison
    2. str1copy: condition on for, implicit comparison
    3. str3cpy: condition on for, implicit comparison from assignment
    4. str4cpy: pure pointers
  6. fileio.c
    1. like program 5 from first handout, but driven by files not standard input
    2. show technique for developing this (program becomes function, add file I/O driver)
    3. go through file manipulation functions

ECS 30-A, Introduction to Programming
Winter Quarter 2002
Email: cs30a@cs.ucdavis.edu