Lecture 24: November 20, 2019

Reading: C text, §2.1, 12.6, 12.8
Due: Homework #4, due November 25, 2019


  1. Greetings and felicitations!
    1. No office hour on Friday; an office hour on Monday 1:10pm–2:00pm
    2. For homework 4 extra credit, it’s -p, not -s; also they can be in any order and have spaces between the option and the number — or not
    3. Grades on Canvas (where it says Total) are not your grade! It doesn’t include the final or any of homework assignments 2–5, does not take into account my dropping the lowest homework score, and does not take into account any curving — and the grading scale is not the one I will use (it’s harsher)
  2. unions: printing other things as bits
    1. characters to bits [union3.c]
    2. floating point to bits [union4.c]
  3. C Preprocessor
    1. #define macros with arguments; contrast with functions
    2. #include "...", #include <...>
    3. #if ... #elif ... #else ... #endif
    4. #ifdef ... #elif ... #else ... #endif, #ifndef ... #elif ... #else ... #endif
    5. #if 0 and #ifdef undef
    6. #undef
    7. #error
    8. #pragma

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 26, 2019 at 12:17AM

You can also obtain a PDF version of this.

Valid HTML 4.01 Transitional Built with BBEdit Built on a Macintosh