Skip to main content
Logo image

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 3 intro).
  • Introduce syntactical and static properties (translation units, functions, declarations, identifiers, keywords, statements, expressions) by means of the factorial example (Section 3.1).
  • Discuss dynamics (function calls, statements, loops) also on that example.
  • Deepen that understanding by walking through an execution trace (Section 3.2).
  • Discuss concept of an imperative variable (in contrast to functional / mathematical variables) (Section 3.3). Stress that containers have an identity (address), an extent, and a life time.
  • Give an overview over the C memory model (Section 3.4).
  • Translation units, different C files compiled separately, demystify ugly header files and include mechanism. main function and program arguments (Section 3.5).

Sections Covered.