Lecture 6: October 7, 2019

Reading: C text, §3.3, 4.6
Due: Homework #1, due October 9, 2019


  1. Greetings and felicitations!
    1. Homework problem 4: there are two files in /home/bishop/hw1-programs that may help:
      1. vis-testfile contains several non-printing characters
      2. vis-output contains the output of vis when given the file as input
    2. Go through why UNIX and C were developed, and where Linux came from
    3. Go through why we are learning C and Linux
  2. How to write a program
    1. Program: calculator that does +, −, *, /, %
    2. Take it to design — then modularize
  3. Functions in C
    1. Parameters: pass (or call) by value
    2. Arguments: instantiations of parameters matched in order
    3. Return values
    4. Scope: local variables
    5. Show the program stack and how it relates to functions
  4. Then translate to C

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 October 12, 2019 at 10:42AM

You can also obtain a PDF version of this.

Valid HTML 4.01 Transitional Built with BBEdit Built on a Macintosh