Learning Resources
This module is populated from the local chunked books in library/raw/semester-04-systems-programming/books. Use this page as a source map, not as an instruction to read everything.
Source Stack
| Book | Role | How to use it in this module |
|---|---|---|
| The C Programming Language (Kernighan & Ritchie, 2nd ed) | Primary teaching source | Default escalation for every C language topic in Clusters 1-5 |
| Computer Organization and Design (Patterson & Hennessy) | Selective support | Use for the translation pipeline, instruction representation, and what the assembler/linker actually produce |
| Code (Petzold) | Background only | Use when you want to rebuild intuition for what the machine is doing underneath C |
| SICP | Optional | Use only if a concept about abstraction clicks better with a Scheme-flavored rephrasing; otherwise skip |
Resource Map by Cluster
Cluster 1: The C Mental Model
| Need | Best local chunk | Why |
|---|---|---|
| first reading of C as a language | K&R: Getting started | Canonical "hello, world" in context |
| abstract machine and pointers | K&R: Pointers and addresses | Best short intro to the address-of-object model |
| the translation pipeline, big picture | COD: Translating and starting a program | Clear walkthrough with diagrams |
| translation pipeline detail | COD: Translating and starting a program (Part 2) | Compiler -> assembler transition |
| object files and linker | COD: Translating and starting a program (Part 3) | What a .o contains and how the linker resolves symbols |
| dynamic linking and load | COD: Translating and starting a program (Part 5) | Useful once you hit "shared library not found" |
| C standards summary | K&R: Appendix C - Summary of changes | Cross-reference between K&R and C89 |
| binary representation backdrop | CODE: Bit by bit by bit | Intuition for what the C abstract machine's bytes are |
Cluster 2: Types, Expressions, and Control Flow
| Need | Best local chunk | Why |
|---|---|---|
| variables and names | K&R: Variable names | Identifier rules and conventions |
| constants and literals | K&R: Constants | Integer, float, character, string literals |
| conversions and promotions | K&R: Type conversions | Integer promotion and usual arithmetic conversions |
| formal conversion rules | K&R: Conversions (A.6) | Reference-manual view of all conversion rules |
| increment/decrement and sequence points | K&R: Increment and decrement | Direct examples of UB traps |
| bitwise operators | K&R: Bitwise operators | Baseline coverage with examples |
| precedence table + rules | K&R: Precedence and order of evaluation | Canonical precedence reference |
| assignment expression semantics | K&R: Assignment expressions (A.7.17) | Needed for subtle = inside conditions |
| statements and blocks | K&R: Statements and blocks | Control-flow basics |
| loops and for | K&R: Loops - while and for | Idiomatic loop patterns |
| break and continue | K&R: Break and continue | When to exit or skip |
Cluster 3: Functions, Scope, and Storage Classes
| Need | Best local chunk | Why |
|---|---|---|
| first functions | K&R: Functions (1.7) | Minimal function example in context |
| function basics in detail | K&R: Basics of functions (4.1) | Prototypes vs definitions clearly stated |
| non-integer returns | K&R: Functions returning non-integers | Why explicit prototypes matter |
| external variables and scope | K&R: External variables and scope | First exposure to file-scope vs block-scope |
| external variables formally | K&R: External variables (4.3) | extern declarations and the single definition |
| scope rules in detail | K&R: Scope rules (4.4) | Block vs file vs function scope |
| initialization | K&R: Initialization (4.9) | Static vs automatic initialization rules |
| scope and linkage, reference manual | K&R: Scope and linkage (A.11) | Formal statement when intuition fails |
| meaning of identifiers | K&R: Meaning of identifiers (A.4) | Linkage and storage duration in one place |
| preprocessor overview | K&R: The C preprocessor (4.11) | Primary #include/#define/#if coverage |
| preprocessor reference | K&R: Preprocessing (A.12) | Formal specification |
| macro expansion detail | K&R: Macro definition and expansion (A.12.3) | Where the subtle rules live |
| external declarations | K&R: External declarations (A.10) | Canonical rules for defining/declaring at file scope |
Cluster 4: Arrays, Strings, and I/O
| Need | Best local chunk | Why |
|---|---|---|
| arrays (first read) | K&R: Arrays (1.6) | Canonical array introduction |
| character arrays and strings | K&R: Character arrays (1.9) | Null-terminator contract in context |
| pointers and function arguments | K&R: Pointers and function arguments | Explains pass-by-value-of-pointer |
| pointers and arrays (decay) | K&R: Pointers and arrays (5.3) | The foundational array-decay chunk |
| address arithmetic | K&R: Address arithmetic (5.4) | p + 1 in terms of element size |
| character pointers vs arrays | K&R: Character pointers and functions (5.5) | String literal vs char[] distinction |
| multi-dimensional arrays | K&R: Multi-dimensional arrays (5.7) | Row-major layout and passing to functions |
| command-line arguments | K&R: Command-line arguments | argc / argv idioms |
| standard I/O intro | K&R: Character input and output (1.5) | getchar/putchar baseline |
| printf and scanf | K&R: Standard input and output (7.1) | Main reference for formatted I/O |
| scanf details | K&R: Formatted input scanf (7.4) | Format specifiers and pitfalls |
| file access | K&R: File access (7.5) | fopen/fread/fwrite/fclose |
| error handling | K&R: Error handling - stderr and exit (7.6) | Where to route errors |
Cluster 5: Structuring C Programs
| Need | Best local chunk | Why |
|---|---|---|
| struct basics | K&R: Basics of structures (6.1) | Canonical struct introduction |
| structs and functions | K&R: Structures and functions (6.2) | Pass-by-value vs pass-by-pointer tradeoffs |
| arrays of structures | K&R: Arrays of structures (6.3) | Layout in memory |
| pointers to structures | K&R: Pointers to structures (6.4) | -> idiom and why |
| self-referential structs | K&R: Self-referential structures (6.5) | Foundation for linked data structures |
| table lookup | K&R: Table lookup (6.6) | Good example of struct + array + hash |
| typedef | K&R: typedef (6.7) | When to alias and when not |
| unions | K&R: Unions (6.8) | Shared storage and tagged unions |
| header / module organization | K&R: External declarations (A.10) | Formal declaration vs definition rules |
| linker perspective | COD: Translating and starting a program (Part 4) | What the linker does with your .os |
Exercise Support Chunks
Use these when the concept pages are understood but your fluency is weak:
- K&R: Word counting example
- K&R: Pointer arrays - pointers to pointers
- K&R: Complicated declarations
- K&R: Bit fields
- K&R: Appendix B - Standard library
- K&R: Appendix B - Standard library (Part 2)
External Resources (Read-If-Curious)
Validated URLs. Use them only when a concept page and the local chunks have not been enough.
- cppreference - C language reference - the best up-to-date reference for every C standard; use for exact wording on conversions, sequence points, format specifiers, and standard library functions.
- cppreference - Translation phases - precise description of the 8 translation phases behind
gcc. - Modern C by Jens Gustedt (free PDF, HAL-Inria) - canonical modern C book; "Level 1" and "Level 2" map well onto this module.
- Beej's Guide to C Programming - approachable second exposition, especially strong on pointers, strings, and stdio.
- cdecl: C gibberish <-> English - paste any complicated C declaration; it explains
int (*(*foo[5])(char *))[3]in English. - GNU make manual - reference for Cluster 5; start with the Introduction to Makefiles chapter.
- GCC Warning Options - reference when tuning
-Wall -Wextra -Wpedantic.
Use Rules
- If you are stuck on a C language feature, go to K&R first; it is still the tightest explanation for this module's scope.
- If you are stuck on the translation pipeline or linker behavior, go to Computer Organization and Design 2.12.
- If K&R feels terse, open Beej's Guide for the same concept and then come back.
- Use cppreference for edge cases and for anything C99+ that K&R does not cover.
- Open one chunk per concept gap. Do not wander through the book.
- If rereading does not fix the problem, stop and rewrite the concept in your own words before reading more.