C programming
Build a precise model of C programs, memory, and compilation. Foundational language rules are separated from compiler extensions; the linked C11 draft is a historical reference rather than a claim about the latest standard.
Get an in-app notice when new lessons or practice are added.
15 chapters across 5 modules
Course chapters
Explore all 15 chapters in any order. Each chapter has learning goals, a practice prompt, and a primary reference; expanded reading pages are linked from their chapter titles.
No matching chapters. Try another term.
01 · From source to running code3 chapters
Compile and inspect a program
- Distinguish preprocessing, compilation, assembly, and linking
Practice: Compile a greeting with warnings enabled and identify the generated executable.
Read the primary referenceLesson guide · ReadyValues, conversions, and limits
- Explain how integer ranges and implicit conversions affect expressions
Practice: Predict signed and unsigned comparisons, then check each with a small program.
Read the primary referenceLesson guide · ReadyBranching, loops, and invariants
- State what remains true at each loop iteration
Practice: Write a bounded sum and test zero, one, and maximum accepted lengths.
Read the primary referenceLesson guide · Ready
02 · Functions and data representation3 chapters
Function contracts and headers
- Distinguish a declaration, definition, parameter, and return value
Practice: Split a unit converter into a header, implementation, and caller.
Read the primary referenceLesson guide · ReadyArrays, bounds, and lifetimes
Follow valid memory accesses rather than guessing from addresses.
- Explain why pointer values do not carry array length or extend object lifetime
Practice: Repair an off-by-one traversal and a function returning an address to an expired local.
Read the primary referenceExpanded reading · ReadyStrings and explicit capacity
- Track the terminator and available capacity of a character buffer
Practice: Read a bounded line, detect truncation, and test the empty string.
Read the primary referenceLesson guide · Ready
03 · Memory and ownership3 chapters
Pointers and indirection
- Trace an address, pointed-to value, and mutation through an alias
Practice: Draw the objects touched by a swap function and test it.
Read the primary referenceLesson guide · ReadyDynamic allocation and cleanup
- Assign a clear owner to every allocated region
Practice: Implement a growable integer buffer with an allocation-failure path.
Read the primary referenceLesson guide · ReadyStructs and representation
- Group related fields without assuming portable padding or byte layout
Practice: Model a reading record and serialize its fields explicitly.
Read the primary referenceLesson guide · Ready
04 · Files and interfaces3 chapters
File operations and errors
- Check open, read, write, and close outcomes deliberately
Practice: Count records in a text file and report an unreadable input.
Read the primary referenceLesson guide · ReadyTranslation units and build steps
- Explain how headers and separate compilation affect a change
Practice: Build a three-file program and rebuild only the changed implementation.
Read the primary referenceLesson guide · ReadyUndefined behavior and portability
- Separate defined, unspecified, implementation-defined, and undefined behavior
Practice: Classify example expressions and replace two nonportable assumptions.
Read the primary referenceLesson guide · Ready
05 · Debugging a practical utility3 chapters
Warnings and sanitizers
- Use diagnostics as evidence while recognizing their coverage limits
Practice: Run a deliberately faulty buffer example under available sanitizers and explain the report.
Read the primary referenceLesson guide · ReadyMemory leak investigation
- Trace the ownership path behind a leaked allocation
Practice: Find and fix a missing cleanup path using a local memory checker.
Read the primary referenceLesson guide · ReadyBuild a bounded text analyzer
- Combine parsing, ownership, and file errors into a testable utility
Practice: Implement line and word counts with documented input limits and regression cases.
Read the primary referenceLesson guide · Ready
Learn it. Check it. Try again.
11 original questions with worked explanations and source references. Filter by difficulty, revisit mistakes, and save your attempt as you go.
Open C programming practiceBooks & references
Free reading at the publisher or author’s site. External materials keep their own licenses.
- C11 committee draft N1570 (2011, historical reference)ISO/IEC JTC1/SC22/WG14 · standard
Source & reuse terms
The standards committee makes this historical draft freely readable. It is copyrighted and is not the current C standard. Link to the committee PDF; no local copy or redistribution permission is asserted.
- GCC compilation stages and invocationGNU Compiler Collection · documentation
Source & reuse terms
Free to read at the official provider. This catalog links to the source; it does not reproduce it or assert permission to redistribute it. Product use, hosted labs, and certificates may have separate costs.
- GCC warning optionsGNU Compiler Collection · documentation
Source & reuse terms
Free to read at the official provider. This catalog links to the source; it does not reproduce it or assert permission to redistribute it. Product use, hosted labs, and certificates may have separate costs.
- GCC runtime checks and instrumentationGNU Compiler Collection · documentation
Source & reuse terms
Free to read at the official provider. This catalog links to the source; it does not reproduce it or assert permission to redistribute it. Product use, hosted labs, and certificates may have separate costs.
- Valgrind quick startValgrind project · documentation
Source & reuse terms
Free to read at the official provider. This catalog links to the source; it does not reproduce it or assert permission to redistribute it. Product use, hosted labs, and certificates may have separate costs.