C Programming
beneath the abstractions โ the language that kernels, databases, and embedded systems are written in. manual memory, pointers, structs, and the compilation model, with no garbage collector and no safety net. understand what your higher-level languages are doing for you by learning the language underneath.
The Basics Without the Safety Net
- 01
Hello World
freehow to compile and run your first C program with gcc, understand why main returns an int, and see why #include is copy-paste not import
- 02
Types, Sizes, and Overflow
freehow C types map to memory sizes, why signed overflow is undefined behavior, and how to use stdint.h for portable fixed-width types
- 03
Control Flow and Functions
freehow to write control flow and functions in C, understand declarations vs definitions, and see why forward declarations and header files exist
- 04
Arrays and Strings
freehow arrays and null-terminated strings work in C, why there's no bounds checking, and how to avoid buffer overflows with strlen, strcpy, and strcmp
- 05
The Preprocessor
freehow the preprocessor works as a text substitution engine, how to use #define macros, include guards, and conditional compilation
Pointers and Memory
- 06
Pointers
freehow pointers work as memory addresses, how to use & and * operators, understand pointer arithmetic, and debug segfaults
- 07
Stack vs Heap
freehow to use malloc and free for heap allocation, avoid dangling pointers, double free, and use-after-free bugs, and understand stack vs heap lifetimes
- 08
Structs and Typedef
freehow to define and use structs, understand memory layout and padding, use typedef and opaque types, and see how Go structs map to C
- 09
Pointers to Pointers and Function Pointers
freehow to use double pointers for arrays of strings, pass pointers to modify values, and implement callbacks with function pointers
- 10
Dynamic Data Structures
freehow to build a linked list with malloc and a dynamic array with realloc, and understand what Go slices and maps hide from you
The Compilation Model
- 11
From Source to Binary
voyagehow source code becomes a binary through preprocessing, compilation, assembly, and linking, and what gcc -E, -S, -c, -o each produce
- 12
Header Files and Separate Compilation
voyagehow to organize .h and .c files, follow the one-definition rule, and compile multi-file projects with separate compilation
- 13
Makefiles
voyagehow to write Makefiles with targets, dependencies, and pattern rules to build real multi-file C projects
- 14
Static and Dynamic Libraries
voyagehow to create static (.a) and shared (.so) libraries, handle linking order, and use ldd and LD_LIBRARY_PATH for dependency management
Writing Real C
- 15
File I/O
voyagehow to read and write files with both buffered (fopen/fread) and unbuffered (open/read) I/O, and when to use which
- 16
Error Handling in C
voyagehow to handle errors in C with return codes, errno, and perror, use goto cleanup patterns, and see what Go improved on
- 17
Undefined Behavior
voyagewhat undefined behavior is, how the compiler exploits it for optimization, and how to recognize and avoid the UB that silently breaks working code
- 18
Building a Project
voyagehow to build a CLI log filter from scratch using structs, dynamic memory, string parsing, and a Makefile โ putting everything together