C, memory and the terminal, explained from the errors everyone runs into.
Errors and crashes
Segmentation fault in C: causes and how to find the line
Your C program stops on "Segmentation fault" and says nothing else? The most common causes, and how to find the exact line with gdb or Valgrind.
Errors and crashes
Errors and crashes
free(): double free detected in tcache 2 in C
double free detected in tcache 2, free(): invalid pointer, munmap_chunk(): invalid pointer: where these glibc messages come from and how to fix the bad free.
Errors and crashes
GCC warnings explained: common messages and how to fix them
control reaches end of non-void function, unused variable, makes pointer from integer, format '%d' expects... Common GCC warnings, their cause and their fix.
Errors and crashes
implicit declaration of function in C: causes and fix
Since GCC 14, calling an undeclared function is an error. Missing include, missing prototype, typo in the name: the cause and the fix for each case.
Errors and crashes
printf not printing before a crash in C: stdout and fflush
Your printf never shows up before a segfault, or vanishes in a pipe? How the stdout buffer actually behaves, and three ways to force the output.
Errors and crashes
undefined reference to in C: fixing the linker error
Your code compiles but ld fails: misspelled main, forgotten .c file, missing -lm, wrong -l order, multiple definition. Each case reproduced with GCC and nm.
Memory and pointers
Memory and pointers
Array vs pointer in C: sizeof, char[] and char *
An array is not a pointer. sizeof, array decay, a[i] and *(a + i), char[] vs char *, 2D arrays, and the error assignment to expression with array type.
Memory and pointers
Linked list in C: insert, delete and free without leaks
A complete linked list in C with no leaks: struct node, insert at the head and at the tail, delete one node, free the list, all checked with Valgrind.
Memory and pointers
malloc, calloc, realloc and free in C: the differences
malloc, calloc, realloc and free: what each one does, the difference between malloc and calloc, and the traps of resizing and freeing memory in C.
Memory and pointers
Pointers in C explained with memory diagrams
Pointers in C explained with memory diagrams: addresses, & and *, swap, arrays, the NULL pointer, pointers to pointers and function pointers.
Memory and pointers
Stack vs heap in C: difference, lifetime and size
Stack vs heap in C: how they differ in lifetime, size and speed, where globals and string literals live, and why returning a stack address is a bug.
The C language
The C language
GCC 15 defaults to C23: what breaks and how to fix it
GCC 15 compiles C as C23 by default: typedef int bool, f() declarations and parameterless function pointers now fail. The exact errors and how to fix each.
The C language
C23 new features: nullptr, constexpr, #embed by example
nullptr, constexpr, typeof, auto, #embed, ckd_add, <stdbit.h>, %b: each C23 feature with an example compiled by GCC 15 and the version that first supports it.
The C language
Strings in C: '\0', strlen, strcpy vs strncpy, strcmp
A C string is a char array terminated by '\0'. What that changes for strlen, strcpy, strncpy, strcmp, strdup and fgets, with the warnings GCC 15 prints.
The C language
Undefined behavior in C: works on my machine, not on yours
Undefined behavior in C, with examples whose output changes between -O0 and -O2, and how to catch it with -fsanitize=undefined, Valgrind and GCC warnings.
Tools and terminal
Tools and terminal
fork in C: wait, waitpid, exec, pipe and dup2
fork duplicates your process, waitpid reads its exit code, exec replaces it, pipe and dup2 connect processes. Every call shown with its output, zombie included.
Tools and terminal
Valgrind output explained: Invalid read, definitely lost
Invalid read of size 4, uninitialised value, definitely lost, still reachable: each Valgrind message explained on a buggy program, and how to fix it.
Tools and terminal
Makefile in C: how to write one, line by line
A Makefile for a three-file C project, built step by step: rules, CC and CFLAGS, $@ $< $^, .PHONY, clean, -MMD, and the missing separator error.
Tools and terminal
Valgrind on Mac M1 and Windows: what to use in 2026
Valgrind doesn't officially run on Apple Silicon Macs or on Windows. Docker, WSL2, leaks, AddressSanitizer: what each one catches and what it lets through.
Learning to code
Learning to code
Auto-grading programming exercises: how it works
How an autograder works, how to write tests that catch real mistakes, the traps to avoid, and how to create your own auto-graded C or Python exercises.
Learning to code
Learn C programming in 2026: where to start
Where to start with C in 2026: what to install, the order to learn the concepts in, how to practice every day, and which serious resources to read.
Learning to code
Learning to code with AI: what the studies say
Is it still worth learning to code when AI writes the code? A randomized trial, the METR study and the 2026 Stack Overflow survey answer with numbers.





















