Kodewick
C course · Beginner

Learn C

From your first printf to pointers, memory and linked lists. Every example runs real C on the page, and stepping through it draws the stack, the heap and every pointer.

Start with lesson 1 →30 lessons · about 8 hours · free · runs in your browser
  1. Part 1Getting startedprintf, variables, operators, then choices and loops.7 lessons · 2 h
    1. Lesson 1Hello, World!15 minStart
    2. Lesson 2Variables and types15 minStart
    3. Lesson 3Output and input15 minStart
    4. Lesson 4Operators15 minStart
    5. Lesson 5if and switch15 minStart
    6. Lesson 6Loops15 minStart
    7. Lesson 7break, continue and nested loops15 minStart
  2. Part 2Functions and arraysYour own functions, arrays, and strings the C way.7 lessons · 2 h
    1. Lesson 8Functions15 minStart
    2. Lesson 9Scope and static15 minStart
    3. Lesson 10Recursion15 minStart
    4. Lesson 11Arrays15 minStart
    5. Lesson 122D arrays15 minStart
    6. Lesson 13Strings are char arrays15 minStart
    7. Lesson 14String functions15 minStart
  3. Part 3PointersAddresses, pointers, and what it looks like when they go wrong.4 lessons · 1 h
    1. Lesson 15Addresses and pointers15 minStart
    2. Lesson 16Pointers and functions15 minStart
    3. Lesson 17Pointers and arrays15 minStart
    4. Lesson 18When pointers go wrong15 minStart
  4. Part 4MemoryThe stack and the heap, malloc and free, memory leaks.4 lessons · 1 h
    1. Lesson 19The stack and the heap15 minStart
    2. Lesson 20malloc and free15 minStart
    3. Lesson 21Memory leaks and dangling pointers15 minStart
    4. Lesson 22Arrays that grow15 minStart
  5. Part 5Your own typesStructs, typedef, enum, and a linked list of your own.4 lessons · 1 h
    1. Lesson 23Structs15 minStart
    2. Lesson 24Pointers to structs15 minStart
    3. Lesson 25typedef and enum15 minStart
    4. Lesson 26Linked lists20 minStart
  6. Part 6Going furtherFiles, macros, bitwise operators, and a small project.4 lessons · 1 h
    1. Lesson 27Files15 minStart
    2. Lesson 28The preprocessor and macros15 minStart
    3. Lesson 29Bitwise operators15 minStart
    4. Lesson 30Project: an address book20 minStart

Questions

Is it really free?

Yes. Every lesson, example and exercise is free, and there is no account to make.

Do I need to install a compiler?

No. The code compiles and runs in your browser with the same results as gcc, and you can watch memory change one line at a time.

Is it real C?

It is C11. Every example in the course is checked against gcc, output and error messages included. A few things (variable-length arrays such as int a[n], for one) are not supported yet, and you are told so when you hit them.

Can C be my first language?

Yes. Lesson 1 starts with printf, and each lesson uses only what came before. C is wordier than Python, though; if you have never coded, Python first makes it easier.

How long does it take?

Each lesson takes 15 to 20 minutes. One or two a day and you are done in about a month. Go slowly through pointers and memory, and press Step a lot.

Can I learn on my phone?

Yes. Reading, running, stepping and the exercises all work on a phone; longer exercises are easier with a keyboard.

Where is my progress saved?

In this browser, with no account. On another device, or after clearing your browser data, it is gone.

What comes after C?

C++ if you want to build bigger programs; data structures and algorithms if you want strong foundations.