Welcome! This repo is a hands-on path to learn C from zero to confident beginner, using short lessons and small programs you can compile and run locally.
- Prerequisite: a C compiler (macOS has clang by default;
gccalso works) - Build all examples with make (see below)
- Prefer VS Code? Install the C/C++ extension and open this folder
- Build all example programs into
bin/examples/:- make examples
- List available examples:
- make list-examples
- Build one example:
- make ex-hello_world
- Run one example:
- make run-hello_world
If you don't use make:
- clang -std=c11 -Wall -Wextra -O0 -g -o bin/hello_world src/01_intro/hello_world.c
| # | Topic | Lesson | Source |
|---|---|---|---|
| 1 | Introduction to Programming | docs | — |
| 2 | Introduction to C Programming | docs | src |
| 3 | C Fundamentals | docs | src |
| 4 | Operators in C | docs | src |
| 5 | Control Structures | docs | src |
| 6 | Functions | docs | src |
| 7 | Arrays | docs | src |
| 8 | Strings | docs | src |
| 9 | Pointers | docs | src |
| 10 | Structures, Unions, Enums | docs | src |
| 11 | File Handling | docs | src |
| 12 | Advanced Topics | docs | src |
Browse 41 runnable examples with tri-lingual comments (EN/SI/TA): examples/
docs/
en/ ← lessons in English (.mdx, source of truth)
si/ ← Sinhala translations (optional)
ta/ ← Tamil translations (optional)
src/ ← compilable lesson source code
examples/ ← 41 standalone example programs
Makefile ← build commands
- History of Programming (Hero of Alexandria, Jacquard Loom, Babbage, Lovelace, Turing, Ritchie)
- Compilers and Interpreters
- High-Level vs. Low-Level Languages
- Features of C
- C Standards (ANSI C, C99, C11)
- First C Program (Hello, World!)
- Compilation Process (Preprocessor, Compiler, Assembler, Linker, Loader)
- Variables (declaration, assignment, scope)
- Constants (
#define,const) - Data Types (char, int, float, double, void; derived and user-defined)
- Type Qualifiers (short, long, signed, unsigned)
- Arithmetic, Relational, Logical, Bitwise, Assignment, Misc (sizeof, &, *, ?:)
- Operator Precedence and Associativity
- Branching: if/else, else if, switch, ?: operator
- Looping: while, do-while, for
- Definition/Declaration, Parameters/Returns, Call flow, Scope rules
- Declaration/Initialization, Access, Passing to functions, Multidimensional
- Initialization and termination (\0), I/O, Manipulation APIs, Examples
- Basics, Dereference, Arithmetic, Arrays/Strings, Double pointers
- Structures, Unions, Enums
- Open/Read/Write/Close, Modes (
r,w,a)
- Dynamic memory (
malloc,free), Recursion, Command-line arguments