C & Unix

Function Pointers and Callbacks

7:34

Plays from YouTube. Watch on YouTube

How can qsort order numbers, strings and custom records with the same sorting routine?

Meet Function Pointers and Callbacks: an original animated lesson in C and Unix systems programming.

We start by reading function pointer declarations and using a typed comparator callback.

Then we trace void pointer conversion, integer comparison without overflow, arrays of string pointers and callback correctness.

The big idea: Function pointers separate algorithmic mechanism from user-supplied behavior while preserving type contracts.

C and Unix explained visually, one concept at a time.