Reference and Selective Reading
You do not need to read the source books front-to-back for this module. Use the concept pages and practice pages first. Open these local chunks only when you need alternate exposition, more worked examples, or a deeper exercise lane.
Source Roles
| Source | Role | Why it is here |
|---|---|---|
| The C Programming Language (K&R, 2nd ed) | Primary teaching source | Most compact canonical explanation of every C language feature at this module's scope |
| Computer Organization and Design (Patterson & Hennessy) | Selective support | Strongest explanation of the translation pipeline, what the assembler produces, and what the linker does |
| Code (Petzold) | Background only | Optional second-pass intuition for the bytes, words, and codes the C abstract machine rests on |
| SICP | Light support only | Opens occasionally when abstraction thinking is the real gap, not C syntax |
Read Only If Stuck
Cluster 1: The C Mental Model
- K&R: Getting started
- K&R: Variables and arithmetic expressions
- K&R: Pointers and addresses
- K&R: Appendix C - Summary of changes
- COD: Translating and starting a program
- COD: Translating and starting a program (Part 2)
- COD: Translating and starting a program (Part 3)
- CODE: Bit by bit by bit
- CODE: Bytes and hexadecimal
Cluster 2: Types, Expressions, and Control Flow
- K&R: Variable names
- K&R: Constants
- K&R: Type conversions
- K&R: Conversions (A.6)
- K&R: Increment and decrement operators
- K&R: Bitwise operators
- K&R: Precedence and order of evaluation
- K&R: Assignment expressions (A.7.17)
- K&R: Statements and blocks
- K&R: Loops - while and for
- K&R: Break and continue
- K&R: Statements (A.9)
Cluster 3: Functions, Scope, and Storage Classes
- K&R: Functions (1.7)
- K&R: External variables and scope
- K&R: Basics of functions (4.1)
- K&R: Functions returning non-integers
- K&R: External variables (4.3)
- K&R: Scope rules (4.4)
- K&R: Initialization
- K&R: The C preprocessor (4.11)
- K&R: External declarations (A.10)
- K&R: Scope and linkage (A.11)
- K&R: Preprocessing (A.12)
- K&R: Macro definition and expansion (A.12.3)
- K&R: Meaning of identifiers (A.4)
Cluster 4: Arrays, Strings, and I/O
- K&R: Arrays (1.6)
- K&R: Character arrays (1.9)
- K&R: Pointers and function arguments
- K&R: Pointers and arrays
- K&R: Address arithmetic
- K&R: Character pointers and functions
- K&R: Pointer arrays - pointers to pointers
- K&R: Multi-dimensional arrays
- K&R: Command-line arguments
- K&R: Complicated declarations
- K&R: Character input and output (1.5)
- K&R: Standard input and output (7.1)
- K&R: Formatted input scanf (7.4)
- K&R: File access (7.5)
- K&R: Error handling - stderr and exit (7.6)
- K&R: Appendix B - Standard library
- K&R: Appendix B - Standard library (Part 2)
Cluster 5: Structuring C Programs
- K&R: Basics of structures (6.1)
- K&R: Structures and functions (6.2)
- K&R: Arrays of structures (6.3)
- K&R: Pointers to structures (6.4)
- K&R: Self-referential structures (6.5)
- K&R: Table lookup (6.6)
- K&R: typedef (6.7)
- K&R: Unions (6.8)
- K&R: Bit fields
- COD: Translating and starting a program (Part 4)
- COD: Translating and starting a program (Part 5)
Optional Deep Dive
- K&R: Word counting - classic small program used throughout the book
- K&R: Low-level I/O - read and write - preview of Module 4 systems I/O
- K&R: Example - an implementation of fopen and getc
- K&R: Example - a storage allocator - sets up Module 2's
malloc - K&R: Appendix A.1 - Introduction to the reference manual
- COD: Representing instructions in the computer - useful if the assembly output from
gcc -Sis still opaque - CODE: Bytes and hexadecimal
- CODE: From ASCII to Unicode
Concept-to-Source Map
| Primary concept | Best source if stuck | Why this source |
|---|---|---|
| C Is a Portable Assembler | K&R: Pointers and addresses | Shortest statement of the address-of-object model |
| The Translation Pipeline | COD: Translating and starting a program | Clearest stage-by-stage walkthrough with diagrams |
| Primitive Types and Integer Widths | K&R: Type conversions | Integer promotion and conversion rules in one place |
| Operators and Sequence Points | K&R: Precedence and order of evaluation | Canonical table plus the sequence-point caveats |
| Functions, Declarations vs Definitions | K&R: Basics of functions | Prototype rules and the compilation-unit model |
| Scope, Linkage, Storage Classes | K&R: Scope and linkage (A.11) | Formal statement when intuition fails |
| Arrays Decay to Pointers | K&R: Pointers and arrays | Canonical explanation of array-to-pointer conversion |
| C Strings and Buffer Safety | K&R: Character pointers and functions | Most concrete treatment of the null-terminated contract |
| Standard I/O | K&R: Standard input and output | Best reference for printf, scanf, fgets at this scope |
| Structs, Unions, typedef | K&R: Basics of structures | Cleanest first pass through aggregate types |
| Header Organization and Modular Builds | K&R: External declarations (A.10) | Formal rules for declaration / definition / linkage at file scope |