C Programming
C Programming
The systems language behind operating systems and most other languages' runtimes -- from the compile-link-run model through pointers, dynamic memory, and undefined-behavior pitfalls.
Who it's for
Learners with some prior programming experience who want to understand manual memory management and how software runs closer to the machine.
What you'll be able to do
- Read and predict the behavior of real C programs covering variables, control flow, functions, and arrays
- Explain how pointers, pointer arithmetic, and malloc/free work, and why C requires manual memory management
- Identify common undefined-behavior pitfalls (buffer overflows, use-after-free, uninitialized variables) in a piece of C code
Not started — 12 lessons, no account required.
Start this coursePractice this course →Add to a study plan →Interview questions →
C Fundamentals
The compile-link-run model, variables and format specifiers, and control flow.
- 15 min
Introduction to C and the Compile-Link-Run Model
What C is, why it still matters, and how source becomes a running program.
- 18 min
Variables, Types, and printf/scanf Format Specifiers
C's basic types, declaring variables, and the format specifiers printf and scanf both depend on.
- 18 min
Control Flow: if, for, while, and switch
C's four control-flow keywords, and the switch fallthrough behavior to watch for.
Functions & Arrays
The stack, arrays, string handling, and multi-dimensional arrays.
- 18 min
Functions and the Stack
Declaring functions, and why C always passes arguments by value.
- 20 min
Arrays and String Handling
Fixed-size arrays, and why a C string is really just a null-terminated char array.
- 18 min
Multi-Dimensional Arrays
Declaring and iterating over a two-dimensional array with nested loops.
Pointers & Memory
Pointers, pointer arithmetic, and dynamic memory with malloc/free.
- 20 min
Pointers and the & and * Operators
What a pointer actually stores, and how & and * relate a pointer to the variable it points to.
- 20 min
Pointer Arithmetic and Arrays as Pointers
How array indexing and pointer arithmetic are really the same operation underneath.
- 22 min
Dynamic Memory with malloc and free
Allocating heap memory at runtime, and the leak/dangling-pointer risks of managing it yourself.
Structs & Program Structure
Structs and typedef, multi-file compilation, and undefined-behavior pitfalls.
- 18 min
Structs and typedef
Grouping related fields with struct, and giving struct types a clean name with typedef.
- 18 min
Header Files and Multi-File Compilation
Splitting a program across .h and .c files, and why #include guards matter.
- 22 min
Common Undefined-Behavior Pitfalls
Buffer overflows, use-after-free, and uninitialized variables -- and the defensive habits that avoid them.
Where to go next
Optional -- these build well on what you just learned, but any course can come next.