C · Foundations
Learn C
The syntax and the mental model. Short, runnable, no fluff.
Learn the Basics
01
Hello, World!
The C programming language is a general purpose programming language, which relates closely to the way machines work.
02
Variables and Types
C has several types of variables, but there are a few basic types: The different types of variables define their bounds.
03
Arrays
Arrays are special variables which can hold more than one value under the same variable name, organised with an index.
04
Multidimensional Arrays
In the previous tutorials on Arrays, we covered, well, arrays and how they work.
05
Conditions
In life, we all have to make decisions. In order to make a decision we weigh out our options and so do our programs.
06
Strings
Strings in C are actually arrays of characters.
07
For loops
For loops in C are straightforward. They supply the ability to create a loop - a code block that runs multiple times.
08
While loops
While loops are similar to for loops, but have less functionality.
09
Functions
C functions are simple, but because of how C works, the power of functions is a bit limited.
10
Static
static is a keyword in the C programming language. It can be used with variables and functions. By default, variables are local to the scope in which they are defined.
11
Enums, typedef and const
Three small features that decide how readable a C codebase is — and one of them is your only real defence against accidental mutation.
Advanced Tutorials
01
Pointers
Pointers are also variables and play a very important role in C programming language. They are used for several reasons, such as: And many more.
02
Structures
C structures are special, large variables which contain several named variables inside. Structures are the basic foundation for objects and classes in C.
03
Function arguments by reference
Assumingly you’re already know pointers and functions, so you are aware of that function arguments are passed by value, which means they are copied in and out of functions.
04
Dynamic allocation
Dynamic allocation of memory is a very important subject in C. It allows building complex data structures such as linked lists.
05
Arrays and Pointers
In a previous tutorial on [[Pointers]], you learned that a pointer to a given data type can store the address of any variable of that particular data type.
06
Recursion
Recursion occurs when a function contains within it a call to itself. Recursion can result in very neat, elegant code that is intuitive to follow.
07
Linked lists
Linked lists are the best and simplest example of a dynamic data structure that uses pointers for its implementation.
08
Binary trees
A Binary Tree is a type of data structure in which each node has at most two children (left child and right child).
09
Unions
C Unions are essentially the same as C Structures, except that instead of containing multiple variables each with their own memory a Union allows for multiple names to the same variable.
10
Pointer Arithmetics
You previously learned what is a pointer and how to manipulate pointers. In this tutorial you will be learning the arithmetic operations on pointers.
11
Function Pointers
Remember pointers? We used them to point to an array of chars then make a string out of them.
12
Bitmasks
Bit masking is simply the process of storing data truly as bits, as opposed to storing it as chars/ints/floats.
13
File I/O
Reading and writing files in C, and the error checks that generated code omits every single time.
14
The Preprocessor
Textual substitution that runs before the compiler sees your code — powerful, and the source of a specific family of bugs.
Get the C agent pack
A battle-tested AGENTS.md, the review checklist, and the failure-mode cheat sheet for C. One email, then occasional updates when the tooling shifts. No course pitch.
AGENTS.md now — no email needed.