All topics / C From Zero

C From Zero

Learn C from nothing to genuinely understanding it: install a compiler and write real programs, then the deep half - pointers, manual memory, the stack vs the heap, and undefined behavior - the things that separate writing C from understanding it.

Download EPUB
  1. Install, Compiling & Your First Program Install a C compiler, understand what compiling actually does (source to object code to executable), and write, compile, and run your first C program with gcc or clang.
  2. Syntax, Variables & Types What does a C program actually look like, and what are int, char, and float really storing under the hood?
  3. Control Flow How C decides which line runs next - if/else, loops, switch, and the handful of footguns (= vs ==, the stray semicolon, switch fallthrough) that catch nearly everyone once.
  4. Functions & Program Structure How do you break a C program into pieces, and why does C insist you declare a function before you can call it?
  5. Pointers I: The Mental Model What is a pointer, actually, and why does C hand you one instead of hiding it like other languages do?
  6. Arrays & Strings How does C store a list of values, and why is there no string type - just a convention involving a zero byte?
  7. Structs & Typedef How do you bundle different kinds of data - a name, an age, a balance - into one thing you can pass around, and why does everyone rename their structs with typedef?
  8. Header Files & the Preprocessor How do multiple .c files share functions and structs, and what is that #include actually doing before your code even compiles?
  9. Build Tooling: Makefiles & Debugging How do real C projects build without retyping a giant gcc command every time, and how do you find a bug when printf isn't enough? Makefiles automate the build; a debugger like gdb lets you pause a running program and look inside it.
  10. Dynamic Memory: malloc & free How do you get memory in C when you don't know the size until the program is running? malloc, free, calloc and realloc - and the one rule that keeps them safe: every malloc needs exactly one free.
  11. The Stack vs the Heap Why does a local array vanish the moment a function returns while a malloc'd one survives, and why does deep recursion crash with 'stack overflow' but a huge malloc just fails cleanly?
  12. Pointers II: Arithmetic, Double & Function Pointers How does `ptr + 1` know to skip 4 bytes for an int but 8 for a double, what is a pointer to a pointer actually for, and how do you store a function in a variable and call it later?
  13. The Standard Library Essentials What's actually in the C standard library beyond malloc and printf - string.h, ctype.h, stdlib.h, math.h - and why C ships so little compared to languages with a 'batteries included' stdlib.
  14. Undefined Behavior & Common Footguns Why does C code sometimes work perfectly on your machine and then crash or misbehave the moment you change compilers, flags, or platforms - and what is undefined behavior actually doing under the hood?
  15. Where to Go Next You've covered the whole language and the deep half - pointers, memory, the stack vs the heap, undefined behavior - so what's next: where C actually gets used, what tools sharpen your memory instincts, and what to build to make it stick.