Master C
The language the machine is easiest to see through. Pointers, memory you manage yourself, and what the compiler does and does not check for you.
Contents
C from the first compile to the systems programming it exists for. Types, control flow, pointers, arrays and the string convention, managing memory yourself, structs, files and the descriptors underneath them, the preprocessor, multi-file programs and the tools that make C survivable, then processes, signals and threads.
Your first C program
C is a small language that hands you the machine and then gets out of the way. This section is one whole program end to end: what C is for, the five lines every program starts from, what the compiler does with them and what it says when it refuses, and how to read a number that somebody types in.
- 9 min
What C is for, and what it is not
A small language with no safety net, and why so much of the software you already use is written in it.
- 8 min
main, printf, and the shape of a program
The five lines every C program starts from, and what each of them is actually asking for.
- 7 min
Printing values, not just fixed text
The percent signs that mark where a number goes, and the count printf hands back when it is done.
- 10 min
Compiling, and reading the errors
One command with four steps hiding inside it, and the four complaints you will meet in your first week.
- 11 min
scanf, and reading what somebody types
printf's mirror image, the ampersand it insists on, and the return value nobody checks until it bites them.
- Easy
Luggage tag
Coding problem · printf, Formatting
- Easy
Splitting the bill
Coding problem · Whole number arithmetic, Division
- Medium
Oven timer
Coding problem · Formatting, Remainders
- Medium
Cost of the trip
Coding problem · Decimals, Mixed arithmetic
Section quiz
Types and values
Opens once you finish Your first C program, including its quiz.
Control flow
Opens once you finish Types and values, including its quiz.
Functions
Opens once you finish Control flow, including its quiz.
Pointers
Opens once you finish Functions, including its quiz.
Arrays and strings
Opens once you finish Pointers, including its quiz.
Managing memory yourself
Opens once you finish Arrays and strings, including its quiz.
Structs and your own types
Opens once you finish Managing memory yourself, including its quiz.
Files and input/output
Opens once you finish Structs and your own types, including its quiz.
File descriptors and mapped memory
Opens once you finish Files and input/output, including its quiz.
The preprocessor
Opens once you finish File descriptors and mapped memory, including its quiz.
Programs in more than one file
Opens once you finish The preprocessor, including its quiz.
Make, debuggers and sanitizers
Opens once you finish Programs in more than one file, including its quiz.
Processes and signals
Opens once you finish Make, debuggers and sanitizers, including its quiz.
Threads
Opens once you finish Processes and signals, including its quiz.
Writing C that survives
Opens once you finish Threads, including its quiz.
Master C unit exam
Opens once every section is finished and every quiz is passed.