CC · Lesson 4 of 8
Functions & Pointers
C functions are straightforward. Pointers less so. But pointers are what make C C, so buckle up.
C passes arguments by value — functions get copies. To modify a variable from a function, you must pass a pointer to it. This is the classic "pass by reference" pattern in C.
◆ Note
Pointer arithmetic in C is one of its most powerful and dangerous features. We'll keep things simple here — the key insight is that pointers enable passing large data structures efficiently and modifying variables from called functions.
Pointer arithmetic in C is one of its most powerful and dangerous features. We'll keep things simple here — the key insight is that pointers enable passing large data structures efficiently and modifying variables from called functions.