Skip to main content

Section C.7 C1: Introduction to C

Synopsis.

This lecture gives an introduction and an overview of the basics of C.

  • Motivate why we need a more high-level language (Chapter 4 intro).

  • Introduce syntactical and static properties (translation units, functions, declarations, identifiers, keywords, statements, expressions) by means of the factorial example (Section 4.1).

  • Discuss dynamics (function calls, statements, loops) also on that example.

  • Deepen that understanding by walking through an execution trace (Section 4.2).

  • Discuss concept of an imperative variable (in contrast to functional / mathematical variables) (Section 4.3). Stress that containers have an identity (address), an extent, and a life time.

  • Give an overview over the C memory model (Section 4.4).

  • Translation units, different C files compiled separately, demystify ugly header files and include mechanism. main function and program arguments (Section 4.5).

Sections Covered.

Section 4.1, Section 4.2, Section 4.3, Section 4.4, Section 4.5