← Back to the blog
C Programming

Learn C from Scratch: A Detailed 12-Part Roadmap

25 June 2026 · A 12-lesson roadmap · Đọc bản tiếng Việt

C is the bedrock of systems programming, operating systems and computer science itself. Learning C trains you to think about hardware resources, gives you a genuine understanding of how RAM works, and lays an extremely solid foundation before you move on to any other language.

This series is laid out as a deliberate path from the basics to the advanced material, with simulated IDE panes and interactive tools running right in your browser, so that learning to program never turns dry.

The full lesson roadmap:

Before you start

What you need to know first. No prior programming experience is required. The series starts with installing a compiler and running your first command. What you really need is to accept that C makes you manage the things other languages handle for you.

What this series does not teach. Not C++ (that has its own series), not embedded or kernel programming. It uses no third-party libraries either — only the standard library, so that everything you see is something you wrote yourself.

What you will be able to do at the end. Read other people's C source, pointer-dense parts included; understand why a program that runs correctly on your machine breaks somewhere else; use valgrind or GDB to track down a memory leak instead of scattering printf calls; and implement a linked list, a stack and a binary tree from nothing, using dynamic allocation.

Why this order. Pointers sit at lesson 8 rather than lesson 3 on purpose: you need to be comfortable with arrays and strings (lesson 6) before you can see what problem pointers actually solve, rather than meeting them as strange syntax. Dynamic allocation (lesson 9) follows immediately, and data structures (lesson 10) come last because that is where those two meet — together with Big O analysis and the effect of the CPU cache.

12 lessons · 12 quizzes · 12 downloadable C source files that compile as they are · an interactive data structure visualiser

01

Setting up a C development environment on macOS, Linux & Windows

Installing GCC/Clang and VS Code, the compiler flags professionals actually use (-Wall, -Wextra, -g), automating the build with a Makefile, and basic debugging with GDB.

02

C syntax basics, variables, data types & I/O

The structure of a C program, variables, scanf/printf, format specifiers, type modifiers, sizeof, enums, constants and type casting.

03

Operators, precedence & bitwise arithmetic in C

Arithmetic, comparison and logical operators. The 15-level precedence table. Bitwise AND/OR/XOR/NOT/shift, endianness and real uses (RGB packing, IP addresses, flags).

04

Branching & loops in C: thinking algorithmically

Conditionals (if-else, switch), loops (for, while, do-while), short-circuit evaluation, jump tables and the goto cleanup pattern.

05

Functions, recursion & variable scope in C

Declarations and prototypes, passing by value, local/global/static variables, recursion (factorial, Fibonacci), variadic functions and function-pointer callbacks.

06

Arrays, strings & text processing in C

1D and 2D arrays, row-major layout, C strings, string.h (strlen, strcpy, strtok and friends), reading input safely with fgets, and more advanced string techniques.

07

Struct, union & the typedef keyword in C

Compound types with struct, padding and alignment, pragma pack, bit-fields, typedef, union, and how each of them really sits in RAM.

08

Mastering pointers in C, from the basics upwards

Memory addresses, single and double pointers, pointer arithmetic, const/restrict, function pointers, a hand-built OOP vtable, and the dangerous pointer bugs.

09

Dynamic allocation & memory management in C

The process memory layout, stack versus heap, malloc/calloc/realloc/free, Valgrind, AddressSanitizer and a professional routine for checking memory.

10

Building data structures in C: linked list, stack & queue

Linked list, stack and queue from scratch. Big O analysis from O(1) to O(N!), CPU cache locality, and the space-time trade-off.

11

Multi-file programming, the preprocessor & build tools in C

Header and source files, header guards, extern/static linkage, the C preprocessor (#define, #ifdef, stringification), conditional compilation and more advanced Makefiles.

12

An in-browser data structure visualiser

The closing lesson. An animated simulation of linked pointers, running directly in the browser, so you can see exactly what each node operation does.