C Course
C is the language underneath operating systems, databases, embedded devices and the runtimes of other languages. This course takes you from your first printf through pointers, dynamic memory, structures, files and multi-file programs to modern C23 — finishing with a complete gradebook application. You'll write careful, modern C: warnings on, safe input handling, and the tools that catch memory bugs.
What you'll learn
The course has 57 lessons in nine parts:
- Getting Started — what C is, installing a compiler, program structure, and how the preprocessor, compiler and linker build a program.
- Variables, Types & Operators — integer and floating-point types, constants,
printfformatting, conversions, bitwise operations and reading input safely. - Control Flow —
if,switch, loops,break,continueandgotofor clean-up. - Functions — parameters, return values, scope,
static, recursion and the maths library. - Arrays & Strings — arrays, 2D arrays, null-terminated strings,
string.handctype.h. - Pointers & Memory — pointers, pointer arithmetic,
const,malloc/free,realloc, memory bugs and sanitizers, function pointers. - Structures & Data — structs, unions, enums, typedef, linked lists,
qsortandbsearch. - Files & Program Structure — text and binary files, command-line arguments, error handling, the preprocessor, multiple source files and
make. - Modern C & Wrap-up — undefined behaviour, C23 features, debugging, best practices and a final project.
Every example in the course was compiled with Clang using -std=c17 -Wall -Wextra -pedantic (and -std=c23 for the C23 lesson) and run, and the output shown is exactly what it printed. Examples compile without a single warning, except where a lesson shows a warning on purpose. The Try it yourself editors let you change any example and copy it to compile on your own computer.
No previous programming experience is needed, though C is a demanding first language — take the pointer lessons slowly.
Practice
- Playground — a starter program to copy and experiment with.
- Exercises — fill-in-the-blank tasks and programming challenges with solutions.
- Quiz — test your understanding across the whole course.
- Syllabus & Study Plan — learning outcomes and a week-by-week schedule.
Lessons
Getting Started
- Introduction to C
- Setting Up a C Compiler
- Your First Program
- How C Programs Are Built
- Syntax and Comments
Variables, Types & Operators
- Variables
- Data Types and sizeof
- Integer Types in Depth
- Floating-Point Numbers
- Constants
- Formatted Output with printf
- Type Conversion and Casting
- Operators
- Bitwise Operators
- Reading User Input
Control Flow
- Conditions with if and else
- switch Statements
- while and do-while Loops
- for Loops
- break, continue and goto
Functions
Arrays & Strings
Pointers & Memory
- Pointers
- Pointers and Arrays
- Pointer Arithmetic
- Pointers and Functions
- const and Pointers
- Dynamic Memory with malloc and free
- Growing Arrays with realloc
- Memory Bugs and How to Find Them
- Function Pointers
Structures & Data
- Structures
- Structs and Pointers
- Unions and Bit-Fields
- Enumerations
- typedef
- Linked Lists
- Sorting and Searching
Files & Program Structure
- Reading and Writing Text Files
- Binary Files and File Positions
- Command-Line Arguments
- Error Handling
- The Preprocessor
- Splitting a Program into Files
- Building with make and CMake