C Foundations
The C you need before pointers
Types that commit to a width and a sign, control flow that is integers underneath, arrays that lose their length at the door, and strings that end in a byte nobody counts. Then the four programs cc runs in a row, driven by hand, until a two-file build is something you did rather than something that happened.
- Modules
- 6
- Drills
- 15
- Build steps
- 7
- Time
- ~5h
Walk out able to
Say what a small C program prints before compiling it, and build one of your own from two source files, a header and a Makefile you wrote.
What you practise
Width, sign and what wraps
Sizing, bit patterns, conversions, masks and specifiers.
Flow that means it
Loop counts, fall-through, and conditions that lie.
Arrays, strings, functions
Indices that land, the plus one, and copies in and out.
The build, by hand
Four stages, four flags, two objects and one Makefile.
The pitch
What you practise, and what you leave with
A word-statistics program over a fixed text: two translation units, a shared header, a hand-run link, and a Makefile that rebuilds only what changed.
You will practise
- Widths, signs, overflow, masks, specifiers
- Loop counts, switch fall-through, false friends
- By-value calls, array bounds, the terminator
- Build stages, macros, and syntax at speed
Afterwards you can
- Predict a small C program before compiling it
- Stay inside an array and size a buffer right
- Say which build stage a message came from
- Link two objects by hand, then automate it
Modules
6 modules, 39 items
Lessons explain one idea. Drills repeat it until it sticks. Build steps make something that exists afterwards.
- 1
Say how big and how signed
~1hSize a declaration, read a bit pattern, and predict what a conversion leaves behind.
- LessonSee what this project is for5 min
- LessonGive every value a size and a sign6 min
- LessonName the three places a value changes6 min
- DrillSize a declaration9 min
- DrillRead a pattern as a signed value10 min
- DrillWrap a fixed-width sum10 min
- DrillCross a type boundary11 min
- DrillMask and shift bits8 min
- DrillMatch a specifier to its value7 min
- 2
Say exactly what runs
~48 minCount a loop, follow a switch past a label, and see a condition that compiles and lies.
- LessonRead a condition as a number6 min
- LessonRecognise the three shapes that lie6 min
- LessonRead a switch as a jump5 min
- DrillCount a loop’s iterations10 min
- DrillFollow a switch past its label10 min
- DrillSpot the condition that lies11 min
- 3
Declare it before you call it
~28 minWrite a function, know what its parameters can and cannot touch, and give it a prototype.
- LessonKnow what a function can reach7 min
- LessonPut the prototype where it will be found6 min
- LessonRecognise an implicit declaration5 min
- DrillSay what the caller still holds10 min
- 4
Stay inside the array
~28 minIndex a fixed-size array safely, and get its length from the only expression that works.
- LessonStay inside the last index7 min
- LessonAsk an array how long it is5 min
- LessonCarry the length across the door6 min
- DrillLand the index inside the array10 min
- 5
Count the terminator
~41 minMeasure a string, size a buffer for one, and write C lines that compile first time.
- LessonFind the byte after the text7 min
- LessonSize a buffer with the plus one6 min
- LessonCount what the text will be6 min
- DrillCount the terminator10 min
- DrillWrite the line that compiles12 min
- 6
Drive the compiler yourself
~2hStop the build after any stage, attribute a diagnostic, and ship a two-file program.
- LessonTake the build apart7 min
- LessonStop the build where you like5 min
- DrillName the stage that refused8 min
- DrillExpand a macro by hand9 min
- Build stepGet a C compiler that answers6 min
- Build stepStop the build four times13 min
- Build stepCount the words in one file9 min
- Build stepMeasure what you counted8 min
- Build stepSplit it and link it yourself9 min
- Build stepFill the histogram you promised8 min
- Build stepWrite the build down10 min
More in Languages
Keep going
Python Foundations
Read a program before you run it. Then write one worth showing.
Foundational~6h8 modules
Python Fluency
Choose the shape before you type. Then say it in one line.
Intermediate~5h7 modules
Python Confidence
Somebody else wrote it. Find out whether it works.
Advanced~7h7 modules
Python Craft
It works. Now make it somebody else's.
Advanced~10h7 modules
Everything before the asterisk, and the build underneath it.
The first item is free. ~5h of focused work, at your own pace.
Intermediate~5h6 modules