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, printf formatting, conversions, bitwise operations and reading input safely.
  • Control Flow — if, switch, loops, break, continue and goto for clean-up.
  • Functions — parameters, return values, scope, static, recursion and the maths library.
  • Arrays & Strings — arrays, 2D arrays, null-terminated strings, string.h and ctype.h.
  • Pointers & Memory — pointers, pointer arithmetic, const, malloc/free, realloc, memory bugs and sanitizers, function pointers.
  • Structures & Data — structs, unions, enums, typedef, linked lists, qsort and bsearch.
  • 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

  1. Introduction to C
  2. Setting Up a C Compiler
  3. Your First Program
  4. How C Programs Are Built
  5. Syntax and Comments

Variables, Types & Operators

  1. Variables
  2. Data Types and sizeof
  3. Integer Types in Depth
  4. Floating-Point Numbers
  5. Constants
  6. Formatted Output with printf
  7. Type Conversion and Casting
  8. Operators
  9. Bitwise Operators
  10. Reading User Input

Control Flow

  1. Conditions with if and else
  2. switch Statements
  3. while and do-while Loops
  4. for Loops
  5. break, continue and goto

Functions

  1. Functions
  2. Parameters and Return Values
  3. Scope, Lifetime and static
  4. Recursion
  5. The Math Library

Arrays & Strings

  1. Arrays
  2. Multidimensional Arrays
  3. Strings
  4. String Functions
  5. Working with Characters

Pointers & Memory

  1. Pointers
  2. Pointers and Arrays
  3. Pointer Arithmetic
  4. Pointers and Functions
  5. const and Pointers
  6. Dynamic Memory with malloc and free
  7. Growing Arrays with realloc
  8. Memory Bugs and How to Find Them
  9. Function Pointers

Structures & Data

  1. Structures
  2. Structs and Pointers
  3. Unions and Bit-Fields
  4. Enumerations
  5. typedef
  6. Linked Lists
  7. Sorting and Searching

Files & Program Structure

  1. Reading and Writing Text Files
  2. Binary Files and File Positions
  3. Command-Line Arguments
  4. Error Handling
  5. The Preprocessor
  6. Splitting a Program into Files
  7. Building with make and CMake

Modern C & Wrap-up

  1. Undefined Behaviour
  2. What's New in C23
  3. Debugging and Best Practices
  4. Project: A Student Gradebook

Practice

  1. C Playground
  2. C Exercises
  3. C Quiz
  4. Syllabus & Study Plan
Where to start: begin with Introduction and set up a compiler in lesson 2 so you can run every example yourself. Afterwards, continue with C++, or keep your code under version control with Git.