C Programming Course
Start with a working compiler
This course starts with the tools you need, then builds from a small C program toward pointers, memory management, data structures, and systems topics. Work through the lessons in order and compile each example yourself.
Course tree
Browse all 101 numbered lessons, grouped by topic. Choose a lesson below or follow the previous/next links at the bottom of each page.
Chapter 1: Getting started and C fundamentals ├── 02 Install C on Linux ├── 03 Install C on Windows ├── 04 Choose Editor/IDE ├── 05 First C Program ├── 06 Comments and Variables ├── 07 Data Types ├── 08 Input/Output ├── 09 Control Structures ├── 10 Functions ├── 11 Arrays ├── 12 Strings ├── 13 Pointers ├── 14 Memory Management ├── 15 File Input/Output ├── 16 Preprocessor Directives ├── 17 Bitwise Operators ├── 18 Advanced String Functions ├── 19 Switch Statement └── 20 Advanced Loops Chapter 2: Data structures and algorithms ├── 21 Recursion ├── 22 Structures ├── 23 Enumerations ├── 24 Pointers and Arrays ├── 25 Command Line Arguments ├── 25 Dynamic Memory ├── 26 Text Processing ├── 27 Random Numbers ├── 28 Sorting - Bubble Sort ├── 29 Sorting - Selection Sort ├── 30 Sorting - Insertion Sort ├── 31 Search - Linear Search ├── 32 Search - Binary Search ├── 33 Pointers Recap ├── 33 Recursion Recap ├── 34 Design Patterns ├── 35 Makefiles ├── 35 Memory Leaks ├── 36 Debugging with GDB ├── 36 Recursion Practice ├── 37 Code Style └── 37 Text Manipulation Chapter 3: Program design and systems ├── 38 Design Patterns in C ├── 39 C Standard Library ├── 40 Complex Types ├── 41 Advanced Preprocessor ├── 42 Design Patterns Part 2 ├── 43 ctype.h Functions ├── 43 Memory Safety ├── 44 Variadic Functions ├── 45 setjmp/longjmp ├── 46 Design Your Own PHI ├── 47 Code Optimization ├── 48 const Qualifier ├── 48 Embedded C ├── 49 Inline Assembly ├── 49 restrict Keyword └── 50 Multi-threading (C11) Chapter 4: Standards, testing, and safety ├── 51 C Standard Review ├── 52 Project Setup ├── 53 Basic Testing ├── 54 Debugging Tips ├── 55 Performance Measurement ├── 56 C vs C++ ├── 57 History and Philosophy ├── 58 Interview Preparation ├── 59 Emulating OOP in C ├── 60 Design Patterns in C Part 2 ├── 61 Memory Optimization ├── 62 Preprocessor Macros ├── 63 Deep Dive Standard Library ├── 64 Compiler Flags and Optimization ├── 64 C Standard History ├── 64 Debugging in Assembly ├── 65 Parallel Programming Patterns ├── 66 File System Navigation ├── 67 Memory Arenas ├── 67 Signal Handling ├── 67 String Safety and Buffer Overflow Prevention ├── 68 Command Line Argument Parsing ├── 68 C Tutorial Summary ├── 68 Design Your Own Language ├── 69 C Best Practices └── 69 Real World C Projects Chapter 5: Modern systems and advanced C ├── 70 CI/CD for C Projects ├── 71 Embedded Kernels and Drivers ├── 72 Performance Profiling Tools ├── 73 Generic Programming ├── 74 Const Correctness Depth ├── 75 Memory Models Explained ├── 76 Inter-Process Communication ├── 77 Basic Socket Programming ├── 77 Accurate Time Measurement ├── 78 Legacy Design Patterns ├── 79 Compile-Time Memory Checks ├── 79 Test Automation Frameworks ├── 80 Modern C Feature Survey ├── 81 C and Assembly Integration ├── 82 Property-Based Testing ├── 83 Network Server Construction ├── 84 Memory Safety LSAN └── 85 Modern C Ecosystem
Set up your environment
On Ubuntu or Debian, install GCC and the standard development tools:
sudo apt update
sudo apt install build-essential
On Fedora, install GCC with sudo dnf install gcc. On Windows 11, use an MSYS2 MinGW-w64 toolchain or Visual Studio Build Tools with the C workload. After installation, open a fresh terminal and verify the compiler:
gcc --version
For more C material, see the existing C tutorial and the topic pages listed below.
Compile your first program
Save this as hello.c. The main function is where execution begins; printf writes a line to standard output.
#include <stdio.h>
int main(void) {
printf("Hello, world!\n");
return 0;
}
Compile, then run the executable. The compiler reports errors before the program runs, so read the first diagnostic and its line number.
gcc -std=c17 -Wall -Wextra -Wpedantic hello.c -o hello
./hello
Hello, world!
Additional C materials
For deeper explanations and related topics, see these established C pages:
Compile the example, then continue through the tutorial and topic pages as you build confidence with the language.