🚀 Alguni Start learning

⚙️ C programming for kids

C is where a computer stops being magic. Types with real sizes, arrays, pointers, struct, malloc and free — the machine underneath every other language on this list.

Start the C track

How this track is kept honest

C runs on an interpreter we wrote, and it is kept honest by putting the same programs through gcc and demanding byte-identical output — including thousands of programs from an outside compiler test suite. Where C has undefined behaviour, the app stops and explains instead of printing junk.

Best after Python. Nothing to install: there is no 40MB compiler to download, and no way to lose your work.

How it starts

In Python you just wrote print. C sits much closer to the machine, so it needs a little scaffolding first. #include <stdio.h> fetches the printing tools, and every C program starts running inside main.

The full C syllabus

11 units and 50 lessons, in the order they are played. Each unit has a page of its own with every explanation in it, the code samples and what they print, and a few questions to try.

Unit 1: Hello, C

Closer to the machine

  1. The Recipe
  2. Labelled Boxes
  3. Showing Values
  4. Hello Machine

Unit 2: Making Choices

Ones and zeros, literally

  1. One and Zero
  2. If / Else
  3. And, Or, Not
  4. Bouncer Bot

Unit 3: Loops & Arrays

Doing things many times

  1. Repeating
  2. Keep Going Until
  3. Arrays
  4. Functions
  5. Number Cruncher

Unit 4: Pointers, Gently

The famous scary bit

  1. Every Box Has an Address
  2. Pointers
  3. Pointer Master

Unit 5: Numbers & Patterns

Remainders and shapes

  1. Leftovers
  2. Shortcuts
  3. Loops Inside Loops
  4. Number Cruncher

Unit 6: Text in C

Letters, one at a time

  1. Letters Are Numbers
  2. Words Are Arrays
  3. Walking Through Words
  4. Asking the User
  5. Word Machine

Unit 7: Types & Sizes

Turning one kind into another

  1. Changing Types
  2. How Big Is It?
  3. The Maths Library
  4. Printing Neatly
  5. Type Master

Unit 8: More Ways to Choose

switch, do/while and bits

  1. Switch
  2. Do It At Least Once
  3. Working With Bits
  4. Choice Master

Unit 9: Functions Deeper

Recursion, scope and sharing data

  1. Functions That Call Themselves
  2. Where Names Live
  3. Passing Arrays
  4. The String Toolkit
  5. Function Master

Unit 10: Structs

Making your own kind of thing

  1. Keeping Things Together
  2. Structs Get Copied
  3. Lots of Them
  4. Names for Types
  5. Unions
  6. Struct Master

Unit 11: Grids & Memory

Asking for space, and giving it back

  1. Grids
  2. Asking for Memory
  3. Chains of Structs
  4. Functions as Values
  5. Memory Master

Other things to learn

Start learning — units 1–2 are free