Skip to main content

C — Intermediate

Understand how C actually works: translation units and linking, pointers as addresses, heap ownership, callbacks, opaque data models, hand-built data structures, byte-exact binary file formats, error contracts, undefined behavior, C11 threads — and a capstone library integrating all of it, verified two-sided against a real gcc.

64 lessons0 challenges~19.75 hoursBeginner — no experience needed

Prerequisite course:C — Beginner

Who this course is for

Learners who finished C — Beginner (or know basic C syntax, pointers and structs) and want to understand why C behaves the way it does — memory, linkage, formats, failure — not just make it compile.

What you will be able to do

  • Reason about translation units, linkage, and the C build model
  • Use pointers, const-correctness, and ownership discipline fluently
  • Design memory-safe APIs with explicit ownership transfer
  • Build and test data structures from scratch with no leaks
  • Read and write byte-exact binary file formats with validation
  • Design error contracts that distinguish caller bugs from states
  • Recognize and avoid the major categories of undefined behavior
  • Write correct C11 threaded programs with mutexes and condition variables
  • Ship a small persistent key-value store library (capstone)

Translation Units, Linking & the Build Model

What the compiler really does with your source: preprocessing, compilation, linking, internal vs external linkage, and how to read the errors each stage produces.

Pointers as Addresses

Pointer arithmetic with one-past-the-end, the four const placements, pointer-to-pointer, and arrays of pointers — the argv model.

Ownership & the Heap

Who owns this memory? Allocation-failure contracts, the realloc growth idiom, and the three classic lifetime violations as API-design failures.

Function Pointers & Callbacks

The syntax read at sight, comparator contracts, dispatch tables, and the callback-with-context idiom that replaces closures in C.

Structs & Data Modeling

Layout you can measure, self-referential types, opaque handles, and the who-frees-it rule written into every API.

Strings & Buffers

Length vs capacity, the safe-copy family, tokenization you can reason about, and parsing that validates before it trusts.

Linked Data Structures

Lists you build from raw nodes: the empty-list is the hard case, the head is a moving target, and every node is freed exactly once.

Hash Tables

Average O(1) you build yourself: load factor, probing, chaining, and the ownership seam of generic values.

Generic Programming in C

void* plus size plus callbacks: the C toolchain for code that works on any type — and the discipline that keeps it type-safe.

Preprocessor Mastery

Macros as text surgery with sharp edges: evaluation hazards, hygiene, token pasting, and compile-time contracts.

Trees & Heaps

Hierarchy with O(log n) ambitions: BSTs where order does the work, heaps where the array does the work.

Binary Files & Robust Parsing

Records on disk: magic numbers, endianness, checksums, random access — and reading files you do not trust.

Errors & Robust APIs

Failure as a designed outcome: codes that cannot be ignored, cleanup that cannot be forgotten, layers that add context without lying.

Undefined Behavior

The optimizer's license: what the standard promises, what it leaves open, and how correct code stays on the defined side of the line.

Concurrency Fundamentals (C11 Threads)

thrd_create, mtx_t, cnd_t: the standard thread vocabulary — and the discipline that makes shared state survivable.

Capstone: MiniKV

Build a persistent key-value store end to end — ownership, binary format, error contract, and tests — everything in this course, in one library.