Learn C
Learn the language underneath everything, one byte at a time.
About this track
C is the small, fast language that operating systems, databases, game engines and the firmware in your car are built with. Learning it shows you how computers really work - memory, pointers, how data is laid out - and makes every other language easier. This track takes you from your first printf to managing memory and building multi-part programs, with real code you compile and run right on the page.
- No programming experience needed - we start from zero.
- Comfort using a computer and a web browser.
- Curiosity about how software works under the hood.
- Unit 1 · 0/2 lessons
Getting started
What C is, and your first real program. Badge: It compiles!
- 0x001What is C, and why learn it?Where C came from, where it runs today, and how a C program goes from text to something your computer can execute. 8 min 8 min
- 0x102Your first program: Hello, worldWrite, compile and run a complete C program, and understand every line of it. 10 min 0/2 exercises solved 10 min 0/2 exercises solved
- Unit 2 · 0/3 lessons
Data and expressions
Variables, types, arithmetic, and talking to the user. Badge: Type safe
- 0x203Variables and typesStore values in named boxes of memory, and learn why every box in C has a type and a size. 12 min 0/1 exercises solved 12 min 0/1 exercises solved
- 0x304Operators and expressionsDo math in C - and learn the two surprises everyone hits: integer division and operator precedence. 12 min 0/2 exercises solved 12 min 0/2 exercises solved
- 0x405Input and outputFormat output precisely with printf, and read what the user types with scanf. 12 min 0/2 exercises solved 12 min 0/2 exercises solved
- Unit 3 · 0/2 lessons
Control flow
Make decisions and repeat work. Badge: Loop de loop
- 0x506Making decisions: if and switchMake your program choose what to do with if, else, logical operators and switch. 12 min 0/2 exercises solved 12 min 0/2 exercises solved
- 0x607Loops: while, for, do-whileRepeat work with loops, control them with break and continue, and avoid the classic off-by-one. 14 min 0/2 exercises solved 14 min 0/2 exercises solved
- Unit 4 · 0/2 lessons
Functions and arrays
Organize code into functions and data into arrays. Badge: Well defined
- 0x708FunctionsBreak programs into named, reusable pieces - and learn why C functions get copies of their arguments. 14 min 0/2 exercises solved 14 min 0/2 exercises solved
- 0x809ArraysStore many values of the same type side by side in memory, and loop over them safely. 14 min 0/2 exercises solved 14 min 0/2 exercises solved
- Unit 5 · 0/3 lessons
Pointers and memory
Addresses, strings, and managing memory yourself. Badge: Pointer wrangler
- 0x9010PointersThe idea C is famous for: a variable that holds the address of another. Less scary than its reputation. 16 min 0/1 exercises solved 16 min 0/1 exercises solved
- 0xA011StringsC has no string type - just arrays of characters ending in a zero. Here is how to work with them safely. 15 min 0/2 exercises solved 15 min 0/2 exercises solved
- 0xB012Dynamic memory: malloc and freeAsk for memory at run time when you don't know sizes in advance - and give it back when you are done. 16 min 0/2 exercises solved 16 min 0/2 exercises solved
- Unit 6 · 0/3 lessons
Building bigger programs
Your own types, files, and professional habits. Badge: Systems thinker
- 0xC013Structs: your own typesGroup related values into one type with struct, name it with typedef, and reach through pointers with ->. 14 min 0/2 exercises solved 14 min 0/2 exercises solved
- 0xD014Working with filesOpen, read and write files with the FILE API, and handle the errors that real files throw at you. 14 min 0/1 exercises solved 14 min 0/1 exercises solved
- 0xE015Writing C like a professionalThe habits, tools and tricks that separate code that works today from code that keeps working. 12 min 0/1 exercises solved 12 min 0/1 exercises solved