Outline for April 10, 2002

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


  1. Greetings and felicitations!
    1. Homework, problem 3: review scanf and how to read in integers
    2. Homework, problem 4: floating point constants (1.0F) vs. double constants (1.0)
    3. Homework, problem 5: how to input newline (^V^J), carriage return (^V^M), bell (^G), form feed (^L), vertical tab (^K), NUL (^2).
  2. dands2.c
    1. switch
  3. pow.c
    1. function prototype & declaration
    2. pass by value vs. pass by reference; C always the former
    3. scope in functions
    4. returning values
  4. copy1.c
    1. strings (NUL-terminated arrays)
    2. printing strings
  5. copy2.c
    1. definition of pointer; address of variables (&), dereferencing of pointer (*)
    2. how it is used
    3. pointer arithmetic (in the printf)
  6. swaps.c
    1. pointers and parameter lists
    2. pointers and var paramaters


ECS 30-A, Introduction to Programming
Winter Quarter 2002
Email: [email protected]