Skip to main content

Section C.8 C2: Expressions and Pointers


  • Briefly outline C's numeric types (Section 4.6), mention signed and unsigned, and explain sizeof properly. sizeof is often mistaken for some kind of run time construct that gives the size of a container.

  • Overview of C's rich expression language (Section 4.8).

  • Implicit type conversion.

  • L- and R-evaluation.

  • Pointers. Motivation: Passing large amounts of data to function. Don't want to copy. Like hiring a contractor: You don't bring them your house but give them your address. Go through execution trace example. Discuss L- and R-eval rules (Section 4.10).

  • Arrays. are special. Degenerate to pointer to first element.

Sections Covered.

Section 4.6, Section 4.8, Section 4.10