Cheat sheets

PCC-09Cheat sheet1 pageIn a paid pack

Functions and Parameter Passing

Call by value as the only C mechanism, emulating call by reference with pointers, swap frames, changing the caller's pointer through a pointer to pointer, array and structure parameters, returning pointers to locals, prototypes and the removal of implicit declarations, unspecified argument evaluation order, the theory models (value, reference, value-result, name) with a computed example, and static versus dynamic scoping.

Diagrams from PCC-09

PCC-10Cheat sheet1 pageIn a paid pack

Scope, Lifetime, Linkage, Storage Classes

Scope (block, file, function prototype, and function scope for labels) and shadowing, storage duration (automatic, static, allocated), linkage (external, internal, none), the auto, static, extern and register specifiers in a lookup table with initial values, static locals initialised once, extern inside a block, declarations versus definitions and tentative definitions, compile errors from register and non-constant static initialisers, and a typical memory layout.

Diagrams from PCC-10