Track 01 · C
The C track
Pointers, the stack, the heap, and what the bytes actually look like.
44 concepts mapped · 13 interactive now · 100 steps · free, no login
01Foundations
4 of 5 liveWhat a variable is, and what the machine sees instead.
- 01
Variables & memory addresses
A variable is a name you gave to a box the machine only knows by number.
intro7 min8 steps0% - 02
Data types & sizes
Why int is 4 bytes, what sizeof really asks, and integer overflow.
intro8 min7 steps0% - 03
Operators & precedence
upcomingEvaluation order, integer division, and the traps in ++i vs i++.
- 04
Control flow
if, loops and switch as jumps — including fallthrough and off-by-one.
intro8 min7 steps0% - 05
Functions & scope
Parameters are copies; locals, globals and static all live differently.
intro9 min7 steps0%
02Pointers
3 of 6 liveThe idea the whole language is built on.
- 06
Pointers 101
A pointer is an ordinary variable. The value it stores happens to be an address.
intro9 min8 steps0% - 07
Pointer arithmetic
p + 1 does not add 1. It adds one element — and the type decides how big that is.
core10 min7 steps0% - 08
Arrays vs pointers
They behave alike in almost every expression — and then sizeof tells the truth.
core9 min7 steps0% - 09
Pointers to pointers
upcomingWhy char **argv works, and how to modify a caller's pointer.
- 10
const & pointers
upcomingReading the declaration right to left: const pointer vs pointer to const.
- 11
void pointers & generic code
upcomingType erasure in C, and how qsort takes any array.
03Memory & lifetime
3 of 5 liveWhere things live, and for how long.
- 12
The function call stack
Every call pushes a frame. Every return pops one. That is the entire mechanism.
core8 min8 steps0% - 13
Recursion on the stack
Nothing special happens. A function calling itself gets a new frame, like any other call.
core9 min9 steps0% - 14
Dynamic memory: malloc & free
The heap gives you memory that outlives the frame that asked for it — and never cleans up after you.
deep11 min9 steps0% - 15
A program's memory layout
upcomingText, data, bss, heap and stack — and which way each one grows.
- 16
Leaks, overflows & sanitizers
upcomingThe five classic memory bugs and the tools that find them.
04Composite data
1 of 5 liveBuilding types out of other types.
- 17
Structs & memory layout
Your struct is bigger than the sum of its fields, and the field order decides by how much.
deep10 min7 steps0% - 18
Unions & enums
upcomingOne block of memory read several ways, and named integer constants.
- 19
typedef & opaque types
upcomingNaming types, and hiding a struct's contents behind a header.
- 20
Linked lists
upcomingNodes scattered across the heap, stitched together by pointers.
- 21
2D arrays & matrices
upcomingRow-major layout, and why arr[i][j] is one address calculation.
05Strings & I/O
1 of 4 liveText is bytes, and files are streams.
- 22
Strings in memory
C has no string type. It has bytes, and an agreement about where they stop.
deep11 min7 steps0% - 23
The string library
upcomingstrlen, strcpy, strcmp and the bounded versions you should prefer.
- 24
printf & scanf
upcomingFormat specifiers, and why scanf is where input bugs come from.
- 25
File I/O
upcomingfopen, buffering, EOF, and why your output appears late.
06Systems & tooling
1 of 5 liveHow C becomes a program.
- 26
Bitwise operations
Eight switches in a byte. These operators flip them in parallel.
core10 min9 steps0% - 27
The preprocessor
upcomingTextual substitution before compilation, and why macros need parentheses.
- 28
Function pointers
upcomingStoring code addresses — callbacks, dispatch tables and qsort.
- 29
Compilation & linking
upcomingPreprocess, compile, assemble, link — and where each error comes from.
- 30
Undefined behaviour
upcomingWhy it works on your machine, and why the optimiser deletes your check.
07Concurrency & threads
0 of 5 liveMore than one thread of execution, and the coordination they need.
- 31
Threads & mutexes
upcoming12 minTwo threads, one shared variable, and the mutex that prevents chaos.
- Create threads with pthread_create and join them
- Use pthread_mutex to protect shared state
- Recognise the classic race condition and why print interleaves
- 32
Atomic operations
upcoming11 minHardware-supported reads and writes that no other thread can split.
- Use _Atomic types and atomic_load / atomic_store
- Compare-and-swap (CAS) as the building block of lock-free code
- See why atomic_int++ is one instruction and int++ is three
- 33
Memory ordering & happens-before
upcoming13 minThe CPU may reorder your writes; a memory barrier is how you say "don't".
- Understand relaxed, acquire, release, and sequentially-consistent orderings
- Read a happens-before diagram between two threads
- Diagnose a bug that only appears on ARM and not on x86
- 34
Lock-free data structures
upcoming14 minProgress guaranteed without any thread ever sleeping — and the ABA problem.
- Implement a lock-free stack with CAS
- Recognise the ABA problem and how tagged pointers dodge it
- Compare lock-free versus mutex throughput as contention rises
- 35
Condition variables
upcoming11 minHow a thread goes to sleep waiting for a condition, and wakes exactly once.
- Pair a condition variable with its mutex
- Wait in a loop and signal after mutating shared state
- Build a bounded producer/consumer queue with pthread_cond
08Systems programming
0 of 5 liveTalking to the kernel — files, processes, and the boundary between them.
- 36
System calls & the kernel boundary
upcoming10 minHow a library function like read() actually leaves userspace.
- Trace a printf call down to the write syscall
- Understand the userspace/kernelspace privilege boundary
- Use strace to see the syscalls your program actually makes
- 37
Signals & async-safe code
upcoming12 minHandlers that fire in the middle of any line, and the rules they must follow.
- Install a signal handler with sigaction
- List which functions are async-signal-safe and why
- Handle SIGCHLD, SIGINT, and SIGSEGV correctly
- 38
mmap & memory-mapped files
upcoming12 minRead a 10 GB file as if it were an array — the kernel pages it in for you.
- Map a file into your address space with mmap
- Understand copy-on-write private mappings
- Share memory between processes via MAP_SHARED
- 39
select, poll & epoll
upcoming13 minWatching a thousand sockets in one thread without spinning.
- Write an echo server with select, poll, then epoll
- See why select degrades linearly with the fd count
- Use edge-triggered vs level-triggered epoll correctly
- 40
fork & exec in C
upcoming11 minDuplicate the current process, then have the child turn into a different program.
- Call fork and act differently in parent vs child
- Replace the child image with execvp
- Reap children with waitpid and avoid zombies
09Performance & hardware
0 of 4 liveWhy the same algorithm can run 10× faster with the right data layout.
- 41
Cache lines & locality
upcoming12 minThe CPU reads 64 bytes at a time; laying data out to match is free speed.
- Predict which of two loops is faster from access patterns alone
- Diagnose false sharing between two threads on the same cache line
- Structure-of-arrays vs array-of-structures trade-offs
- 42
Branch prediction & mispredicts
upcoming10 minThe CPU guesses which way an if will go; a wrong guess costs ~15 cycles.
- Explain the famous sorted-vs-unsorted array performance gap
- Use __builtin_expect (likely/unlikely) sparingly and correctly
- Replace unpredictable branches with branchless arithmetic
- 43
Alignment & SIMD intrinsics
upcoming14 minProcess 4 or 8 elements per instruction with hand-rolled vector code.
- Use aligned_alloc and understand why unaligned SSE crashes
- Vectorise a hot loop with _mm_add_ps intrinsics
- Read the assembly that the auto-vectoriser did (or didn't) produce
- 44
Profile-guided optimisation
upcoming9 minRun the program, feed the profile back to the compiler, get a 10% speedup.
- Build with -fprofile-generate, run a representative workload, rebuild with -fprofile-use
- Understand what the compiler learns (hot paths, likely branches, inlining)
- Know when PGO helps and when it doesn't
The full syllabus is listed above in teaching order. Concepts marked upcoming are mapped but not yet built as visualizations. Progress is kept in this browser only.