Lecture 18: November 4, 2019

Reading: C text, §10
Due: Homework #3, due November 8, 2019

  1. Greetings and felicitations!
    1. Homework 1 grades have been posted
      1. Be sure it runs on the CSIF and you use -ansi -pedantic -Wall when you compile
      2. Also, comments must be /* … */
      3. All declarations at he beginning of functions or blocks, not in for loops
    2. Homework 2 is now reopened until Wednesday so you can fix things that you lost points for on homework 1
  2. Structures
    1. User-defined datatype
    2. As fields: var.field, ptrvar->field
    3. Use example of list of numbers (usort2.c)
    4. Do insertion sort (linked.c)
  3. Parallel arrays and arrays of structures
    1. Show parallel arrays to sort planets in order of diameter (planets1.c)
    2. Show same program using structures (planets2.c)
    3. typedef
    4. Using sizeof to get size of an array

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 November 4, 2019 at 3:39PM

You can also obtain a PDF version of this.

Valid HTML 4.01 Transitional Built with BBEdit Built on a Macintosh